A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java 8 in Action
this week in the
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
Don't get me started about those stupid
subject: How can I use many-to-one without foreign-key
Composite key as foreign key problem.
question about Enity mapping
Foreig key must have same number of columns as the referenced primary key
Hibernate one-to-one mapping with foreign 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