-->
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: Can I perform a "Pre-Delete"?
PostPosted: Tue Feb 24, 2009 2:50 pm 
Newbie

Joined: Tue Feb 24, 2009 2:46 pm
Posts: 1
Is there any way to determine if a given delete would cause a foreign key constraint violation without performing the delete and then rolling it back?

_________________
Barry Ostroff
Magpie Telecom Insiders


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2009 7:43 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
If you association mapping is bidirectional you can see the size of the collection and see if the entity you are going to delete is referenced by any other entities. Otherwise you ll have to make DB queries to see if any entity is referencing the entity you are about to delete.

_________________
Regards,
Litty Preeth


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.