I have a java code like this:
JSONObject jsonObj = new JSONObject(output);
JSONArray json_response = jsonObj.getJSONArray("DataList");
for (int i = 0; i < json_response.length(); i++) {
JSONObject jsonobject = json_response.getJSONObject(i);
Tblshop tblshop = new Tblshop();
tblshop.setSHID(jsonobject.getInt("SHID"));
tblshop.setShimagename(jsonobject.getString("ShImgName"));
tblshop.setShname(jsonobject.getString("ShName"));
tblshop.setShoff(jsonobject.getInt("ShOff"));
tblshop.setShstate(jsonobject.getInt("ShState"));
tblshop.setShstar(jsonobject.getInt("ShStar"));
tblshop.setShtask(jsonobject.getInt("ShTask"));
tblshop.setShvarification(jsonobject.getInt("ShVarification"));
tblshopDao.insertOrReplace(tblshop);
}
But I don't want to use a set for One by one field and I want to do that with a loop or something and just take Model(Structure name) and that loop does this with the field names.
What can I do about this (The model Field names are exactly like Json Array field names).