1

In JPA

When each entity points to the other, the relationship is bidirectional. If only one entity has a pointer to the other, the relationship is said to be unidirectional.

I would assume that a JPA bidirectional relationship in the Relational model would map as many to many relationship,but I see that in JPA bidirectional relationship applies also to one to one and one to many relationships.

1.Do bidirectional relationship exists in the Relational model?I thought that everything is unidirectional and you can retrieve the necessary data by joining tables.I only would consider many to many as such.

2.What is the actual purpose of a bidirectional relationship regarding JPA? wouldn't also everything work out if the relationships where unidirectional?

microwth
  • 1,016
  • 1
  • 14
  • 27
  • 1
    Does this answer your question? [What is the difference between Unidirectional and Bidirectional JPA and Hibernate associations?](https://stackoverflow.com/questions/5360795/what-is-the-difference-between-unidirectional-and-bidirectional-jpa-and-hibernat) – Simon Martinelli Aug 13 '21 at 09:34
  • Thanks,this does answer partially.It doesn't answer if the biderictional relationship has a counterpart in the Relational model.Is it a departure from it and is it just a making of JPA alone? – microwth Aug 13 '21 at 09:58
  • 1
    It's just a JPA construct. In the database there is only one FK – Simon Martinelli Aug 13 '21 at 11:26

0 Answers0