In this JPA example there is a code:
@OneToOne(cascade=CascadeType.ALL)
private Deity mother;
@OneToOne(cascade=CascadeType.ALL)
private Deity father;
@OneToMany(cascade=CascadeType.ALL)
private Set<Deity> children;
Why relation with father and mother is implemented by @OneToOne annotation and not in @ManyToOne relation? If Child and Parent will be separate classes Parent will have @OneToMany Collection<Child> children
and Child have @ManyToOne Parent parent
. This (deity) example seems reasonable but I looking for explanation why is that.
Links to JPA specification will be very appreciated.