• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why use <many-to-one> for having <one-to-one> foreign key relationship?

 
Mustafa Garhi
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey ranchers,

If i need to have one-to-one unidirectional foreign key based relation between a Mouth and a Tongue i have to have this is in my Mouth.hbm.xml :

<many-to-one name="tongue"
column="tongueid"
unique="true"
/>


Why is <one-to-one> tag itself not powerful enough for this work?

Do we have a tutorial that teaches what exactly each such tag (e.g. <one-to-one>) is supposed to do and what it is not?

Thanks buddies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic