spatik wrote:
Hai,
From the UI I send two objects mapped to two different tables.
My insertion order in two tables are these,
I insert the first object to the table and it generates a id based on the insertion and I use the id value which is dynamically generated as part of the second object and insert that into the second table.
Now is there a way to do this seemless with hibernate mapping.
To be more clear, can I specify a column of one table in hibernate mapping file to be dependent on the value generated by another table.
My insertion in the second table depends only when there is insertion in the first table.
Please give me some suggestions. Is there any particular topic in hibernate addressing this issue I'm working with!!!!
In mapping file, set the id-generator :"assigned" so you will assign the id,
After inserting the first object, read its id, generate the second object's id, and assign it