0

I was answering a SO question about entity mappings, and there was two possible ways to do the mapping : either with OneToOne or (ManyToOne + a UniquesConstraint).I have been always avoiding the use of OneToOne relationship, I always choose to do it with ManyToOne and add some unique constraints for both scenarios Unidirectional and bidirectional, I had no problem with that.

I was just wondering what it the best practice ?

I read some Q/A in so and I am aware of this answer but it doesn't answer my question.

Thank you .

Community
  • 1
  • 1
Rafik BELDI
  • 4,140
  • 4
  • 24
  • 38
  • http://stackoverflow.com/questions/2452987/hibernate-why-use-many-to-one-to-represent-a-one-to-one is a better discussion of the subject than the post you referenced. – Tim Jul 15 '14 at 23:07
  • @Tim thanks, i didn't see that before :) – Rafik BELDI Jul 15 '14 at 23:11

0 Answers0