aspose file tools*
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
Author

why join keyword is needed

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
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,
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

The join keyword is left off for example when there is no relationship between the entities as described in this post:
http://www.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


[How To Ask Questions][Read before you PM me]
 
 
subject: why join keyword is needed
 
Similar Threads
Urgent help needed Please.Urgent
Externalizable Interface
r they keywords or literals?
main app won't stop when all threads are done running
org.hibernate.exception.GenericJDBCException: could not execute query