Reputation: 810
I've database where I'm joining tables O...1 that is one to optional one.
What tag should I use in persistence Entity class @OneToOne or @OneToMany relationship?
Thanks for your help.
Upvotes: 1
Views: 486
Reputation: 692121
@OneToOne is what you're looking for. Its optional attribute is used to tell if its a 1-0..1 or a 1-1. By default, optional is true, so it means that it's a 1-0..1.
@OneToOne
optional
Upvotes: 2