-->
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: Problems with 'cascade="all-delete-orphan"'
PostPosted: Tue May 17, 2005 12:39 pm 
Regular
Regular

Joined: Sun Nov 07, 2004 3:39 pm
Posts: 77
I recently changed a mapping from cascade='all' to cascade='all-delete-orphan'. Now I find that when go to save the parent object, I get the message:

net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"

I'm not sure what dereferencing a collection means. Any pointers? If it's any help, what I'm doing immediately before that is:

a) Getting a list of child records matching the parent id, 'direct' from Hibernate (i.e, not via the parent record).

b) Changing a 'position' property in them, to enable a specific sort order.

c) Loading the parent record.

d) Creating a HashSet from the list.

e) Assigning it to the collection property in the parent record.

f) Saving the parent record.

This all works fine when it's just 'cascade="all"', but not when it's 'cascade="all-delete-orphan"'.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 12:21 pm 
Beginner
Beginner

Joined: Thu Mar 03, 2005 9:19 pm
Posts: 22
http://www.hibernate.org/264.html

user update instead.


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.