This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate mapping

 
Nital Chandel
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one Table1(parent table) which is having one primary key column (id) and two other columns (code_type and code_value) combination of both is unique.

Now another table Table2, which is a child table, has column (prob_type) which is referencing Table1 column (code_value), and NOT the primary key (id).

I dont think that there is any solution from DB point of view. Is there some property in Hibernate which I can use so that both the tables can be mapped or related through Hibernate mapping files?
 
Edvins Reisons
Ranch Hand
Posts: 364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A foreign key may reference any unique column(s) of the target table, and not necessarily the primary key.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic