-->
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.  [ 1 post ] 
Author Message
 Post subject: cascading to set null in child
PostPosted: Fri Mar 21, 2008 3:55 pm 
Newbie

Joined: Wed Feb 20, 2008 10:53 am
Posts: 15
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2

A question about cascading . . .

Let's say I have a table "A" which maps to class "A" and
a table "B" which maps to class "B"

Their relationship is one-to-many, that is A can have many B's.

Table and class B contains idA, a foreign key to A.

Now let's say I delete a record from A and I want the corresponding idA in B to be set to null. How should I set the cascade option here?

<bag name="BList">
<key column="idA"/>
<one-to-many class="B"/>
</bag>

Thanks

Eric


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

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.