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
|