• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@JoinColumn V/s @JoinTable

 
ambar patil
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can do 1 to many unidrectional mapping
through both @JoinColumn or @JoinTable. whats the difference between two?
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ambar,

Use @JoinColumn when the Entities have direct relationship i.e a foreign key between Entity1 and Entity2.
Use @JoinTable when you manage the relationship between Entities in another table also referred to as JoinTable.

Hope that helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic