posted 11 years ago
Hi.. JavaRanch forum member I am having one problem in inserting data to my POJO having one to many relationship with each other.
I am using JPA persistence layer with spring and Ext JS 4.0.2a as a frontend technology
my Project pojo class is
my Task pojo class is
the relationship is like One project may have many Task.
the json data i am receiving on my server side is
as my id is unique and autoincreement so no need to pass id. But i am having problem with the insertion of this JSON data i am receiving as the Project primary key is associated in relation with Task.
I tried to assign the values with the below method
I tried to insert the Task with jsonTask but not able to assign task to POJO Task. When i removed the jsonTask all data in assigned to Project POJO.
So is there any way i can insert data to Project table of my database and Project's startDate, endDate,projectId will also be inserted to my Task table
Yogendra Singh
Sr. Programmer
Kintudesigns.com