-->
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: Please help. meaning of cascade in many-to-one.
PostPosted: Thu Jan 29, 2004 7:49 pm 
Beginner
Beginner

Joined: Tue Nov 18, 2003 12:34 am
Posts: 39
Location: Dallas, Texas, US
Hello,
cascade in a many-to-one does not make sense to me.

I have cascade="all" for a many-to-one (as there is no explicit relationship from the other end). While creating the first child, Hibernate inserts the parent row and then the child row. While creating the second child, it seems Hibernate is doing an insert on the parent table with the same parent id causing errors. Given the definition of cascade, this behavior is expected, but this is not what I wanted.

I am just curious to know the motivation for a cascade option in the many-to-one relation. This insight will help me determine other options in designing my entities.

Thanks,
Madhan.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 8:20 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You're wrong.
when saving an object, a cascaded subobject will be saveOrUpdate()
Your unsaved-value are wrong.

_________________
Emmanuel


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.