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.  [ 1 post ] 
Author Message
 Post subject: problem with cascade
PostPosted: Mon Feb 14, 2005 6:41 pm 
Beginner
Beginner

Joined: Thu Feb 03, 2005 7:23 pm
Posts: 23
Hello,

I am using H3, and I have a problem with cascade: here is my mapping documents:

I am storing class Node in table NODE, and in table REF, I have references
to class Node, as source and target. everything works well, I can save, load, etc nicely, but I can not delete, although I set cascade="delete" on my Ref class.

I made a small experiment, I opened the table REF in my database utility, and changed the foreign keys for SOURCE and TARGET to cascade, then I was able to delete. Schema export somehow does not honor the cascade="delete" statement.

Please notice I am not using a collections mapping scheme.

Thanks in advance.

-O.B.

<hibernate-mapping>
<class name="Node" table="NODE" schema="BASE">
<id name="vid" type="long">
<generator class="sequence" />
</id>
<property name="data" type="java.lang.Integer">
<column name="DATA" not-null="true" sql-type="NUMBER" />
</property>
</class>
</hibernate-mapping>

<hibernate-mapping>

<class name="Ref" table="REF" schema="BASE">
<id name="eid" type="long">
<generator class="sequence" />
</id>
<many-to-one name="source" class="Node" column="SOURCE" cascade="delete" not-null="true"/>
<many-to-one name="target" class="Node" column="TARGET" cascade="delete" not-null="true"/>
<property name="weight" type="java.lang.Double">
<column name="Weight" not-null="true" sql-type="NUMBER" />
</property>
</class>
</hibernate-mapping>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.