-->
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: many-to-one and BatchUpdateException again. Basics.. Help!!
PostPosted: Tue Apr 25, 2006 3:00 am 
Beginner
Beginner

Joined: Thu Feb 10, 2005 12:23 pm
Posts: 21
I have <many-to-one > relation from "child" class to "parent" class. But no reverse association <one-to-many>/<many-to-many> from parent to child.
When I delete parent, it throws BatchUpdateException if any child was pointing to the row in parent(nested ConstraintViolationException)

How can I prevent DDL from generationg foreign key constrain for a simple <many-to-one> association??

Tried not-null="false", not-found="ignore", cascade="none" etc.. in the hbm.xml . still the schemaexport by build.xml generates a foreign key constraint which prevents me from deleting parent..

I want to delete parent even if childs may be referring. Please help!!!!

Thanks,
Hari Sujathan.


Top
 Profile  
 
 Post subject: many-to-one causing deltion problem in related class
PostPosted: Tue Apr 25, 2006 8:18 am 
Beginner
Beginner

Joined: Thu Feb 10, 2005 12:23 pm
Posts: 21
I temporarily use 'deleted' flag to mark a row as deleted. Will manually deleting foreign key constraint in ddl generate do the job along with attribute - not-found="ignore"?

Thanks in advance,
Hari


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.