final List<JsonObject> rows = ar.result().getRows(); final JsonArray result = new JsonArray(); rows.forEach(result::add); gotSupplierRawMaterialID.complete(result); LOG.debug("result " + rows);
result [{"id":72,"receiptno":"908","dateofentry":20200819,"supplier":10,"rawmaterialid":14,"quantity":20},{"id":72,"receiptno":"908","dateofentry":20200819,"supplier":10,"rawmaterialid":11,"quantity":80}]I want to modify the result to match my model class which is like so,
public class SendToCompanyFromSupplier { private Integer id; private Integer entrydate; private String receiptno; private Integer warehouse; private Integer supplier; private ArrayList<Rawmaterialwh> rawmaterialwh; }and
public class Rawmaterialwh { Integer rawmaterialid; Integer qty; }and return the result like so
{ "id" : 72, "entrydate" : 20200819, "receiptno" : "908", "warehouse" : 0, "supplier" : 10, "rawmaterialwh" : [ { "rawmaterialid" : 14, "qty" : 20 }, { "rawmaterialid" : 11, "qty" : 80 }, { "rawmaterialid" : 18, "qty" : 60 } ] }
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE