-->
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: columns must be ordered for the cascade delete to work ?
PostPosted: Thu Jun 02, 2005 5:00 am 
Beginner
Beginner

Joined: Wed Feb 16, 2005 1:22 am
Posts: 25
Location: Jakarta
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
Oracle 9.2.0.1

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hi,

I'm just curious. I've searched in the documentation, and as far as i've known there is no part that states that in the <set for one-to-many, must have ordered foreign key columns for join and cascading delete to work. Am i missing it ?

This works :
Quote:
<set
name="mstSlstrgBranches"
lazy="true"
inverse="true"
cascade="all">
<key>
<column name="PRODUCT_CODE" />
<column name="BUREAU_CODE" />
<column name="SLSMAN_TYPE_CODE" />
</key>
<one-to-many
class="distr.mst.model.MstSlstrgBranch"
/>
</set>

This doesnt work(there is no exception in the joins, but the cascading delete resulted in oracle's constraint violation exception) :
Quote:
<set
name="mstSlstrgBranches"
lazy="true"
inverse="true"
cascade="all">
<key>
<column name="SLSMAN_TYPE_CODE" />
<column name="BUREAU_CODE" />
<column name="PRODUCT_CODE" />
</key>
<one-to-many
class="distr.mst.model.MstSlstrgBranch"
/>
</set>


Thanks in advance,
Albert Kam
[/b]

_________________
Greater in battle
than the man who would conquer
a thousand-thousand men,
is he who would conquer
just one —
himself.


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.