This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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