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
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
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
Special Association Mapping in Hibernate
Composite key as foreign key problem.
Foreig key must have same number of columns as the referenced primary key
question about Enity mapping
Hibernate one-to-one mapping with foreign key
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015