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: joined-subclass and delete cascade
PostPosted: Wed Nov 24, 2004 9:54 pm 
Newbie

Joined: Wed Nov 24, 2004 9:31 pm
Posts: 1
Is there an option to add "ON DELETE CASCADE" to the foreign key generated as a result of a joined-subclass? For example, if I have class Child defined as a joined-subclass of Parent using the key "foo". Then Hibernate would issue a:

ALTER TABLE Child ADD CONSTRAINT "FKxxxxxxxx" (foo) REFERENCES Parent;

However, this is missing a "ON DELETE CASCADE". As a result, a deletion of an instance from the Parent causes a foreign key violation. What I want to have is:

ALTER TABLE Child ADD CONSTRAINT "FKxxxxxxxx" (foo) REFERENCES Parent ON DELETE CASCADE;

What would be the solution/workaround to this problem? I can't find any option to add this "ON DELETE CASCADE" to the "<joined-subclass ..." declaration.

Thanks.

-- Jiang


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.