A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Object Relational Mapping
How can I use many-to-one without foreign-key
Joined: Aug 29, 2006
Aug 12, 2008 01:21:00
How can I use many-to-one with unique column, that column is not foreign-key. Here is a code,
<many-to-one name="department" column="gdm_id" unique="false" class="com.greenlight.testxpert.persistence.Department" cascade="none" not-null="false" foreign-key="FK_USR_DEPT" />
Now If I don't have "gdm_id" as a foreign-key, it only a unique column. Then how could I map to Department unique column.
Thanks & Regards,
Joined: Feb 05, 2001
Aug 12, 2008 10:03:00
I don't see the use of foreign-key in many-to-one in this from the Hibernate docs pages.
It seems it is just using some column not a specific FK field.
Perfect World Programming, LLC
Two Laptop Bag
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: How can I use many-to-one without foreign-key
question about Enity mapping
Composite key as foreign key problem.
Hibernate one-to-one mapping with foreign key
Foreig key must have same number of columns as the referenced primary key
Special Association Mapping in Hibernate
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014