-->
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: add an fk that with the referring value that does not exist
PostPosted: Thu Jun 10, 2010 11:29 pm 
Newbie

Joined: Thu Jun 10, 2010 10:53 pm
Posts: 1
so basically i have this table that requires me to input the id of another table, wherein the values of for those id's does not exist yet. i'm not quite sure how to implement this with hibernate but i have a few thoughts on how it should work.

the first is i forgo the fk and just force the application to join the two via a join or by find id.

the second would be that i create a reference table containing the fk of the first and second table, with the second table being null-able, and another column which would contain a duplicate values of the second table's id as well as allow for the supposedly non existing values to exist.

the problem with the solutions are that of the added complexity of catching if both exist in both tables input form, the aforementioned forcing of the join as well as the loss of some of hibernates features. now I'm not gonna be picky with the solution i just wan't to know if their is a more elegant solution to the problems stated above. thanks to those who would reply


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.