Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Gajen Pingalkar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic