-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem with left outer join
PostPosted: Thu Feb 01, 2007 9:14 am 
Newbie

Joined: Thu Feb 01, 2007 8:50 am
Posts: 2
HQL Query
select p.name from Person p left outer join PersonEvent pe on p.personId=pe.person.personId

In PersonEvent table personId is foreign key of Person table.
Person table is having one-to-many relation with PersonEvent

I am getting exception : outer join or full join must be followed by path expression
If I modify above query with following one then it executes fine.

select p.name from Person p left outer join p.personEvents pe

Here personEvents is set having PersonEvent objects.


Please suggest me a solution.


Thanks,
kuldeepak


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 2:49 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi kuldeepak,

use

select p.name from Person p left fetch join p.personEvent

_________________
Dharmendra Pandey


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 6:44 am 
Newbie

Joined: Thu Feb 01, 2007 8:50 am
Posts: 2
Hi,
Thanks for your suggestion but it will work only if two tables have relation in between.If two tables don't have relation in them then 'on' clause will be needed which throws exception

Thanks,
Kuldeepak


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.