I am filling a List and then I try to write it to the database. We have two Entity Classes: Application and Education. The relationship is 1:N. (One application can have many educations) In the Application entity class I have created a List of Education with the relationship ONE_TO_MANY. Mapped by attribute is appl. In the Education entity class i have created a field appl with the relationship MANY_TO_ONE. The Problem is, that i have to initialize all objects before i can write data into them. this is impossible to do, because the application Object has a Education object in it and the Education Object has a Application object in it. Is there an other way to save my data to a database? thanks. asked 20.04.2016 at 16:25 joha0123 |
You can set the relation if you assign appl to eduction and then persist em. You may have to persist them within a single transaction.
I've created a similar datastructure and a demo project here: simpleJpa_51.iar
answered 22.04.2016 at 11:41 Reguel Werme... ♦♦ Alex Suter ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 20.04.2016 at 16:25
Seen: 2,826 times
Last updated: 07.03.2018 at 10:38