hai,i am using Hibernate3.0 one to many mapping...the problem is when i am using one to many,i am trying to map from parent to child..but this child has a foreign key which refers to parentID of parent table which is sequence generator..now if i want save the parent records,my parent id has to go to map the child,which is one -many here..how it is possible here..bocz of my parent will create . then only that id goes to child know...is it possible?or any other way........?
Hi, This is a typical case, of having parent/child relationship in Hibernate. Hibernate takes care of ordering the sequence of sqls, so you need not worry about the FK violations. You just have to provide the appropriate <set> mapping in the hbm files