Mr.DevEng
Mr.DevEng

Reputation: 2421

JPA associations implementation difference in bidirectional and uni directional

Upvotes: 1

Views: 60

Answers (1)

Mudassar
Mudassar

Reputation: 3225

Lets take an example where in one entity A is mapped to many entity B

  1. If you will be fetching data for/querying from entity A and wont ever need to fetch from entity B the going for unidirectional One-to-Many mapping makes sense.
  2. But if you would be querying from entity A as well as from entity B it is recommended to go for bidirectional One-To-Many

Upvotes: 1

Related Questions