user1048282
user1048282

Reputation: 810

one to optional one relationship in EclipseLink

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

Answers (1)

JB Nizet
JB Nizet

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.

Upvotes: 2

Related Questions