-->
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.  [ 3 posts ] 
Author Message
 Post subject: Can't Delete Cascade with <composite-element>
PostPosted: Fri Dec 09, 2005 2:00 pm 
Newbie

Joined: Tue Nov 22, 2005 3:16 pm
Posts: 4
I can't seem to get cascade deletes to work with composite-elements. The classes I have are pretty simple, yet for all configurations I try it seems to do something wrong. This is an example of the mapping that causes trouble:

Code:
<class name="com.sagebrush.pinpoint.dataobject.Configuration" table="CONFIGURATION" lazy="false">
   <id name="id">
      <generator class="assigned" />
   </id>

... a few normal properties...

   <bag name="onSiteIpMasks" table="ON_SITE_IPS" lazy="false">
      <key column="configurationId" />
      <composite-element class="com.sagebrush.pinpoint.dataobject.IpMask">
         <property name="mask"/>
      </composite-element>
   </bag>
</class>


Whenever I try to remove a configuration, I get ConstraintViolationExceptions from the ON_SITE_IPS table. I tried adding cascade="all-delete-orphan", which did absolutely nothing. I tried adding inverse="true", which made the onSiteIps not to be saved anymore (even with cascade="all-delete-orphan"). I tried to add on-delete="cascade" to the key, but that's not allowed (hibernate complains about not being an inverse one-to-many).

This seems like such a simple problem yet I can't figure what's wrong. Is this a bug? Expected behaviour? If so, how do I create a managed, dependent component???

[]s Gus


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 8:46 am 
Regular
Regular

Joined: Wed Nov 26, 2003 6:22 am
Posts: 76
Location: Stockholm
I have the exact same problem. Delete fails....


Top
 Profile  
 
 Post subject: me too
PostPosted: Fri Apr 14, 2006 2:40 am 
Newbie

Joined: Fri Apr 14, 2006 1:50 am
Posts: 8
Location: Peking
the same problem. there are lot of posts describing the same problem, but I did not find a solution along with them

_________________
bravery can set you free.


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