File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Node.js in Action
this week in the
Object Relational Mapping
Joined: Jun 20, 2008
Jun 20, 2008 13:22:00
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?
Joined: Dec 11, 2006
Jun 23, 2008 03:13:00
A foreign key may reference any unique column(s) of the target table, and not necessarily the primary key.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: hibernate mapping
Hibernate: Different Join in Save() and Get()
one-to-many mapping with table having no primay key
Problem with joining of two tables with Hibernate
Hibernate many-to-one composite key as foreign key
Composite Foreign Key that maps to Unique Constraint
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014