-->
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.  [ 4 posts ] 
Author Message
 Post subject: Statements with FULL OUTER JOIN
PostPosted: Thu Nov 08, 2007 10:12 am 
Newbie

Joined: Thu Nov 08, 2007 9:50 am
Posts: 5
Hello everybody,

I have a big problem with a statement wich looks like this:
Code:
"select distinct  alias0

from Establishment as alias0 full outer join EstablishmentContact as alias1 on (alias0.subsidiaryID =  alias1.EstablishmentId), Establishment  as alias0 full outer join ServiceDepartment  as alias2 on (alias0.subsidiaryID =  alias2.EstablishmentId) cross join, ServiceDepartment  as alias2 full outer join ServiceDepartmentContact  as alias3 on (alias2.Id =  alias3.ServiceDepartmentId)

where alias1.Id  in (  '20D30CF0-B433-4D26-B50E-A32B866D1E82' )

order by  alias0.name "

If I try this statement in my database it works fine, but within my java code with
Code:
Query query = session.createQuery(...)


I get following error:
"org.hibernate.hql.ast.QuerySyntaxException: expecting "join", found 'outer' near line 1..."

I've tried it with full join or outer join and some other changes, but nothing worked.
Has anybody an idea or knows where the problem is???

I appreciate any help.
Thanks in advance.
Bye Stephie


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 08, 2007 3:15 pm 
Newbie

Joined: Wed Oct 31, 2007 5:36 pm
Posts: 13
Code:
full outer join


is not a valid HQL syntax.


Either replace all instances of "full outer join" with "left join" or "full join"


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 09, 2007 3:21 am 
Newbie

Joined: Thu Nov 08, 2007 9:50 am
Posts: 5
Thanks for your advice.
I tried it with full join, but then there was a bit later an error with "on".

I don't know what the problem is.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 09, 2007 5:04 am 
Newbie

Joined: Thu Nov 08, 2007 9:50 am
Posts: 5
In some cases it works with this statement:
Code:
select distinct  alias0
from  Establishment  as alias0,  EstablishmentContact  as alias1,  ServiceDepartment  as alias2,  ServiceDepartmentContact  as alias3 
where  alias0.subsidiaryID =  alias1.EstablishmentId and 
       alias0.subsidiaryID =  alias2.EstablishmentId and 
       alias2.Id =  alias3.ServiceDepartmentId and 
       alias1.Id  in (  '25B6A2B8-0403-42C9-925B-DAA3BF014244' ) 
order by  alias0.name


But here there is only an inner join used.
I need an full join, cause if there is an ServiceDepartmentContact without an enty in Establishment, EstablishmentContact this statement returns null.

Maybe this helps for the understanding why I need an full join.

Hope there is anybody with advice.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.