aspose file tools*
The moose likes Object Relational Mapping and the fly likes How can I use many-to-one without foreign-key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How can I use many-to-one without foreign-key" Watch "How can I use many-to-one without foreign-key" New topic
Author

How can I use many-to-one without foreign-key

Gajen Pingalkar
Ranch Hand

Joined: Aug 29, 2006
Posts: 37
Hi All,
How can I use many-to-one with unique column, that column is not foreign-key. Here is a code,

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,
Gajen
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

I don't see the use of foreign-key in many-to-one in this from the Hibernate docs pages.

http://www.hibernate.org/hib_docs/v3/reference/en/html/associations.html#assoc-unidirectional-m21

It seems it is just using some column not a specific FK field.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can I use many-to-one without foreign-key