This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a parent object
Its primary key is auto increment field in MYSQL
This is simply parentID
now parent ID also exists in the child object as a foreign Key
So inserting Parent works fine
Inserting child has a blank parent ID in its foreign key field
I do not have foreign key constraint in place on the database as i would get a foreign key constraint error then
But how can I get Hibernate to insert a row, pick up on the new primary key, set that key in the child rows
my child rows are a List in the parenet. The list is set to cascade="all"
I am saving by
Can give working sample code or link to a comprehenise example please