• Post Reply Bookmark Topic Watch Topic
  • New Topic

JPA

 
shashank dwivedi
Ranch Hand
Posts: 65
AngularJS Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JPA.I am confused in Directionality.
If we have two entities say Employee and Project.what does it really mean they are bidirectional relationship??
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they both have a relationship to each other, then they have a bi-directional relationship.

i.e.
 
shashank dwivedi
Ranch Hand
Posts: 65
AngularJS Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Sutherland wrote:If they both have a relationship to each other, then they have a bi-directional relationship.

i.e.


Shashank Dwivedi wrote: yes but that means many to many is always bidirectional right?
 
shashank dwivedi
Ranch Hand
Posts: 65
AngularJS Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shashank dwivedi wrote:
James Sutherland wrote:If they both have a relationship to each other, then they have a bi-directional relationship.

i.e.


Shashank Dwivedi wrote: yes but that means many to many is always bidirectional right?


Shashank Dwivedi wrote: Ok I think I got it.
Can we check Directionality with -HAS- test.
for example, say we have two entities Employee and Address.Now Employee has a address but address don't need to have a Employee so it is uni-directional.
And again if we have two entities Employee and Project.Now Employee has project and project also has employee so it is a bi-directional mapping.
Am I Correct??
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!