File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes why join keyword is needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "why join keyword is needed" Watch "why join keyword is needed" New topic

why join keyword is needed

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 196
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 == d.eid.

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

Bill Gorder

Joined: Mar 07, 2010
Posts: 1682

The join keyword is left off for example when there is no relationship between the entities as described in this post:

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

[How To Ask Questions][Read before you PM me]
I agree. Here's the link:
subject: why join keyword is needed