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 .