• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why join keyword is needed

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Being a entry level programmer, i want to know very basic thing. Why does hibernate queries need "Join" keyword. Is it just syntactical thing ?

In plain SQL, we can write something like Select from Employee e , Department d where
e.id == d.eid.

There is no Join keyword used here still its inner join. Is'nt ?

Thanks,
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The join keyword is left off for example when there is no relationship between the entities as described in this post:
https://coderanch.com/t/487010/ORM/databases/jpql-join

However implicit join syntax can be used where the associations are de-referenced using dot notations which results in an inner join in the resulting SQL statement.

Have a read of this blog, which I think did a pretty good job explaining things
http://java-persistence-performance.blogspot.com/2012/04/objects-vs-data-and-filtering-join.html
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic