-->
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: Problem with cascade and update
PostPosted: Wed Nov 29, 2006 2:08 pm 
Newbie

Joined: Thu Feb 02, 2006 9:39 am
Posts: 19
Hibernate version: 3.1

I do have a father object containing a collection of children, with a cascade set to "all-delete-orphan".

When I do a saveOrUpdate() on a newly created father, (ie: not in session), the children are correctly cascaded. For instance I could retrieve their database id (generated with "increment") just afterwards.

But if I modify an existing father (in my case, clearing the collection, and adding some children), and do a saveOrUpdate on the father, the children id are not set. (cascade not made ?)

I do have to wait after the session.commit() to be able to get the children id. (And in my design I need to get this id after the saveOrUpdate(), not after the commit()).

Note that my father does not have any other value changed. Only the elements in its collection.

Is it a known behavior? Do I have to browse myself the hierarchy, and manually save each of the children?

PS: sorry for the duplicate post. (The website was quite disturb at the moment of the post)

--
Hugo


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.