-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: cannot insert NULL into foreign key
PostPosted: Sat Mar 20, 2004 6:37 pm 
Regular
Regular

Joined: Sun Oct 26, 2003 9:02 pm
Posts: 90
Hi

I have two tables with a parent child relationship 1:n. I'm mapping the relationship like this:

<list name="childs" cascade="all">
<key column="foreign_key"/>
<index column="order_seq"/>
<one-to-many class="mypackage.Child"/>
</list>

When I insert a child element into the list property and save the parent object I get "cannot insert NULL" into then foreign key. Shouldn't Hibernate put the value in the foreign key column???


Top
 Profile  
 
 Post subject: Read chapter 6
PostPosted: Sat Mar 20, 2004 7:23 pm 
Regular
Regular

Joined: Sun Oct 26, 2003 9:02 pm
Posts: 90
I read chapter 6. The solution is there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.