I have a list of records in a entity type ,i had a confusion the way how to represent in column wise list or each of record as a json
object,that means list of JSON
Objects.
::Explanation ::
Here firstName
, secondName
, thirdName
are column names
. Need To Represent Like this format
__ {{firstName:Rec1,secondName:Rec1,thirdName:Rec1},{firstName:Rec2,secondName:Rec2,thirdName:Rec2}...n}__
But i approached like
_ _{firstName:[Rec1,Rec2,Rec3...],secondName:[Rec1,Rec2,Rec3...],thirdName:[Rec1,Rec2,Rec3...]},__
When i tried to pass as a entity type means it shows like
__{"ServiceData":[com.aiway.eea.ejb.to.student.ParentStudentDetailsTO@8b0db2,com.aiway.eea.ejb.to.student.ParentStudentDetailsTO@1304967]}__
Please Help me to solve this...
we not able to pass as a entity type,we need Transfer Object to convert from ENTITY to JSON object,if List entityType means then Use List JSONObject and then put that List of JsonObject to another Json object like <"serviceData":JsonObject> then it will OUTPUT like {"ServiceData":[{"parentId":4009,"parentRelation":"Father","parentNotification":false,"parentOccupation":"bussiness","parentEducation":"mba","parentName":"tharun"},{"parentId":4010,"parentRelation":"Mother","parentNotification":false,"parentOccupation":"sdfsdf","parentEducation":"sdfsdfs","parentName":"rakshitha"}]}
You can retrive like the Example syntax See The Example From this IMAGE Link....
use this Link to lean about JSON Array https://www.w3schools.com/js/js_json_arrays.asp
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.