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: How do I stop schema update creating foreign key?
PostPosted: Tue May 03, 2011 8:05 pm 
Newbie

Joined: Tue Sep 08, 2009 7:38 pm
Posts: 6
I have a class which has a foreign key that I need to define an association for.

However, this class can be distributed across multiple sites (different, remote databases) where the foreign class may not exist.

I can remove the foreign key constraint in the database and I can use the @NotFound(IGNORE) annotation to stop exceptions when the foreign class does not exist, but the schema update always wants to recreate the FK when I have it set to 'update'.

Is there any way to selectively stop the schema update from creating a foreign key constraint?

It would be really nice if the schema update 'saw' the NotFound annotation and used it's presence as an indicator not to create the FK constraint.

By the way, I will listen to any comments about bad design, but I doubt there is any other way to distribute objects to remote databases without their associated foreign classes. Surprise me.


Cheers, Duncan.


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.