Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Using @JoinColumn VS not using @JoinColumn

Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I would just like to clarify the difference between the following 2 code samples from EJB3 in Action:
First code sample:

2nd Code Sample:

The 2nd code sample is missing the @JoinColumn.

So in the 1st case it would be possible to use the foreign key in the User table to locate the relevant Bid/s using SQL.

Whereas the 2nd case wouldn't have a foreign key BUT it would still be possible to access the relevant Bid/s through the User object's reference to a collection of Bids albeit only via JPQL this time?
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic