-->
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: What will effect cascade="all, delete-orphan"
PostPosted: Wed Jan 18, 2006 12:41 pm 
Newbie

Joined: Thu Sep 15, 2005 11:42 pm
Posts: 4
Hibernate version: use Jboss403sp1 , should be hibernate-3.1rc2.

Just wonder what will effect a success cascade="all, delete-orphan" for a Set collection (detached).
1. Child class should implment hashcode and equals.
2. pass to Diffenrent VM.
3. Keep the ref of collection.
4. dereference from Child side
5. do not detached.

Problem: like a some other's topic in this form, I only can persistence new add Child in Set collection(in a detached parent), but not delete.

I pass through the detached object via different VM. And My test shows little funny for me.

Say parent class is "A" Child is "B" B did not implment hashcode and equals. GUI call no state session Bean.

1. create A and few B in remote GUI side. send to server to save.
2. Check if it is a Transient just save it and close session, then it become detached return to GUI.
3. GUI modif A'set then save again, sever get the detached A , then load A's old version(persisitent) by uid.
4. check those B has been deleted by compare Detached and persisitent Object. Use (A's Old version) remove and dereference those B. saveOrUpdate
5. (Why have to have it for delete) flush() session;
6. Use (A's Old version ) 's set.clear() then pop any thing in detached A to persisitent A saveOrUpdate();


if I didn't have 2-6, only have single saveOrUpdate, not delete.
if I didn't have 5 flush , not delete (why?)
if I didn't have 4,5 just do 6 not delete ( why?)



Can anyone help? Thank.


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.