-->
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.  [ 8 posts ] 
Author Message
 Post subject: ID after Session.delete()
PostPosted: Thu Apr 15, 2004 3:41 am 
Newbie

Joined: Fri Mar 12, 2004 9:33 am
Posts: 17
What will become with object's ID after calling Session.delete(obj)?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well it will just be deleted from the database ... the object itself is still in the same state as before.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:42 am 
Newbie

Joined: Fri Mar 12, 2004 9:33 am
Posts: 17
I mean with ID of persistent object. Nothing or it'll become NULL if unsaved-value='null'?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:46 am 
Newbie

Joined: Fri Mar 12, 2004 9:33 am
Posts: 17
Well, I have some problem... I delete object and then try to remove it from collection, but it isn't removed... But when I set ID of deleted object to NULL, it is removed... What's wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Your equals/hashCode method is crap.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:51 am 
Newbie

Joined: Fri Mar 12, 2004 9:33 am
Posts: 17
But equals method returns true...
Please look at http://forum.hibernate.org/viewtopic.php?t=929920


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 4:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I suspect your equals/hashCode results are not stable over the object lifetime.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 4:16 am 
Newbie

Joined: Fri Mar 12, 2004 9:33 am
Posts: 17
Is it legal to create equals/hashcode methods around ID attribute?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.