I want to iterate the Arraylist of Arraylist, get the values and insert them into table. My code is working for single Arraylist. What I have achieved for single list is:
private String setreportColLinksBean(List<Map<String, String>> allValuesMap) {
for (Map<String, String> result: allValuesMap) {
Map<String, String> map = new HashMap<String, String>();
if (result.get("it_datatype") != null) {
map.put("it_datatype", (String) result.get("it_datatype"));
it_datatype = result.get("it_datatype");
}
if (result.get("item_value") != null) {
map.put("item_value", (String) result.get("item_value"));
item_value = result.get("item_value");
}
ReportLinks reportlinks = new ReportLinks();
reportlinks.setItem_datatype(it_datatype);
reportlinks.setItem_value(item_value);
saveReportLinks(reportlinks);
}
}
But I want to iterate data which is like this:
[
[
{it_datatype=Character, at_desc=Scholarship Form, it_code=ITM0001, at_bpcode=PR00000122},
{it_datatype=Character, at_desc=Scholarship Form, it_code=ITM0002, at_bpcode=PR00000122}
],
[
{it_datatype=Character, at_desc=initiate 2, it_code=ITM0001, at_bpcode=PR00000625},
{it_datatype=Character, at_desc=initiate 2, it_code=ITM0002, at_bpcode=PR00000625}
]
]
How do I iterate this list and get the values for inserting them into the table. I am very new to Java. Please help. TIA.