This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a parent-child unidirection relationship.
on the child mapping I have the follwoing mapping
I do a hibernate session saveOrUpdate on a new parent and new children.
My parent will have mutilple child objects in its child List
SQL output shows parent inserted, children inserted and the foreign key(PARENT_ID) on all the children is updated.
The returned object has all primary keys now set (parent and children primaru keys) yet all Java Child POJO foreign key attribute (parentID) is still NULL.
Yet i query the database and i see the foreign key is populated
I have to refresh my parent object for the foreign key attribute on the children to be populated.
Any ideas on why initially the Java Child POJO parentID attribute is NULL
I have to do teh followingto get the foreign key attribute to refresh: