Hi all...

Is there a way for Hibernate to persist the parent before any children? I've an object Foo which has a child Bar, and the mapping looks like this:

<class name="Foo">
 <id name="id">
   <generator class="assigned" />
 </id>
 <one-to-one name="bar" class="Bar" />
</class>

<class name="Bar">
 <id name="id">
     <generator class="assigned" />
 </id>
</class>

I'm having problems because Bar's id must be a foreign key into Foo. Because Bar gets created before Foo, I get a constraint violation. Is there a way around this? I suspect that this would also be necessary to support normalized mappings.

Thanks,
-Mark



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Reply via email to