posted 17 years ago
Greetings,
I really need help on this. I am trying to use Hibernate to insert on two table on the database. The relation is of type Parent/Child. The problem is that it inserts well on the Parent table but on the Child table it doesn't insert.
Debuging through the project I've found out that he makes an INSERT for the first table but for the second table it makes an UPDATE.
The hbm.xml files that I've built are bellow, the first file has lot of thing but what is used for these tables is at the end:
The precious hbm.xml file has a joined-class that works fine and has a set for a collection that is doing an update instead of an INSERT.
The class that is used in the set implements the following hbm.xml file.
Here is the SQL statements that are produced by the hbm.xml files
I really need answers for:
How can I force the hbm.xml file to do an INSERT instead of an UPDATE?
Thanks for any reply
Many Thanks,
Rui F�lix