-->
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: SchemaExport and cascade delete constraints
PostPosted: Fri Jan 05, 2007 12:36 pm 
Newbie

Joined: Tue Nov 28, 2006 2:37 pm
Posts: 7
Is is normal for Hibernate's auto schema ddl generation to generate two FK constraints when an association specifies cascade delete (@OnDelete(action=OnDeleteAction.CASCADE)). I get the following constraints:

alter table cal_property_index add constraint FKBA988E7927801F2 foreign key (eventstampid) references stamp
alter table cal_property_index add constraint FKBA988E79FD15B882 foreign key (eventstampid) references stamp on delete cascade

Shouldn't there only be the second?

-Randy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 2:01 pm 
Newbie

Joined: Tue Nov 28, 2006 2:37 pm
Posts: 7
Nevermind, figured out the problem.

I was defining @OnDelete(action=OnDeleteAction.CASCADE) on the many-to-one association instead of the one-to-many (it is bi-directional).


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.