in this answer, the author said:
Take an example of two entities mapped without declaring a owning side:
@Entity
@Table(name="PERSONS")
public class Person {
@OneToMany
private List<IdDocument> idDocuments;
}
@Entity
@Table(name="ID_DOCUMENTS")
public class IdDocument {
@ManyToOne
private Person person;
}
From a OO point of view this mapping defines not one bi-directional relation, but two separate uni-directional relations.
1.My first question is: Why it is not a bi-directional relation?
In a bidirectional relationship, each entity has a relationship field or property that refers to the other entity. Through the relationship field or property, an entity class’s code can access its related object
in the above code, both class have a relationship field that refers to the other entity. then why it is not a bi-directional relation and these are two uni-directional relations?
2.My second question is: what is the difference between two uni-directional relations and one bi-directional relation? aren't they same thing?