Why option #3 is not correct ?
Even explanation says that it's correct.
Also, there is a possiblity to create OneToMany unidirectional association without join table:
Code: Select all
@Entity
public class Employee {
@Id
@Column(name="EMP_ID")
private long id;
...
@OneToMany
@JoinColumn(name="OWNER_ID", referencedColumnName="EMP_ID")
private List<Phone> phones;
...
}
Code: Select all
@Entity
public class Phone {
@Id
private long id;
...
}