-->
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.  [ 5 posts ] 
Author Message
 Post subject: How can I prevent objects/rows to reference deleted objects?
PostPosted: Thu May 17, 2007 2:13 pm 
Newbie

Joined: Thu Mar 29, 2007 3:38 am
Posts: 18
Hello :)

Can you tell me how I can prevent objects to reference other deleted objects ?

I get this error when loading such objects...

Quote:
No row with the given identifier exists: [com.company.webapp.bo.Country#1]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.company.webapp.bo.Country#1]


Thanks !


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 2:17 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
if an object is a member of a collection, remove it from that collection before saving saving changes. Deleting it in the database simply won't help if it is referenced in your program

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 2:21 pm 
Newbie

Joined: Thu Mar 29, 2007 3:38 am
Posts: 18
no, these objects aren't member of any collection...

They are independent objects...


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 3:09 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
well. That error tells me what you're trying to load isn't in the database. Nothing wrong with that.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 3:57 pm 
Newbie

Joined: Thu Mar 29, 2007 3:38 am
Posts: 18
... ok, but I want these (useless) references to be "cleared" when I delete objects...


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