Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Help with left outer join
PostPosted: Wed Aug 22, 2012 10:32 am 
Newbie

Joined: Wed Aug 22, 2012 10:25 am
Posts: 2
I am new to Hibernate. Following is a simple select statement that I am trying to replicate in HQL/JPA
select e1.*
from emp e1 left outer join emp e2
on e1.keyid = e2.pkeyid
where e1.empid = :empid

Can someone please let me know the correct syntax for this query in HQL. I have tried several options but it fails

like select e1
from emp e1 left join emp e2
on e1.keyid = e2.pkeyid
where e1.empid = :empid


or

select e1
from emp e1 left join emp e2
where e1.empid = :empid
and e1.keyid = e2.pkeyid

Do I have to add anything to the mapping file.
Thanks for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.