-->
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.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: outer join problem
PostPosted: Wed Jan 26, 2005 8:22 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
Hi all
I try to use a left outer join in my sql.
But I always got this error
net.sf.hibernate.QueryException: outer or full join must be followed by path expression


and that my query
<query name="printdocument.hibernate.decreto">
<![CDATA[
select ud.comp_id.tipoIdUtentegruppo,ug.comp_id.idGruppo from TUtenteGruppo as ug left join TUtentegruppoDecreto as ud on ud.comp_id.idUtentegruppo =ud.comp_id.idUtentegruppo
]]>
</query>

Please help.
Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 9:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please read the manual on how the join syntax in HQL is.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 10:12 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
I read te manual I found that syntax.
Can u suggest me any examples?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 10:14 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There are several dozen query examples in the documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:27 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
of course but no one define the element clause of the left outer join.
I'm not sure of using the syntax 'on column1=column2' or another one.
Has I have to specify xml tag in mapping xml?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:30 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
As stated in the FAQ, there is no explicit join condition (what you call "on") in HQL at the moment. It's on the list.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:32 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
so I have to define an outer join without element column clause.
But I wonder what sense it has.Colud u explain me please?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:35 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I don't understand you. Its probably better if you continue writing your queries in SQL until you have time to learn HQL.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:39 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
MMM...
I 'm using a query in an xml.
With hibernate I get the query etc etc.
In which way u mean I should use sql instead of HQL.
Can I put SQL in the mapping xml instead of HQL?
That's colud be great.
But hibernate allow just HQL in mapping hbm files.Isn'it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:40 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You can also use SQL. Please, this is all documented for a reason. Read it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 11:41 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
hi dilembo,
just one tip: hibernate in action, read about HQL, and SQLQuery

second tip: don't forget to read all the book ;), you'll learn fast

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 12:55 pm 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
Sorry for be boring but actually in my hbm files I can use just HQL.
Could u suggest me the specific link where to find SQL embedded in a hbm file?
Actually I've done a boring job converting sql in hql in my hbm file and could be great using directly SQL enbedded in hbm.
What I do not like is enbedding SQL in java code.I prefer to separate that.
Please be more specific if u can help.
Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 12:57 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the reference documentation, SQL chapter.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 1:11 pm 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
I found <sql-query> but know it dows not fetch anything.
any idea? Probably I should configurig something in hibernate.cfg.xml.but what?


Top
 Profile  
 
 Post subject: Re: outer join problem
PostPosted: Mon Sep 19, 2005 11:05 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:32 am
Posts: 25
Location: Austria/Vienna
well the documentation on join is very sparse. he uses "on", the documentation does not mention it (as far as i know), but a simple clearing statement from any hibernate team member would have been better than just joking about a newbie ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

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.