-->
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.  [ 1 post ] 
Author Message
 Post subject: Right outer join syntax for Hibernate with My Sql 5.1
PostPosted: Mon Jun 29, 2009 2:17 am 
Newbie

Joined: Fri Jun 26, 2009 4:51 am
Posts: 2
Try 1:
Query in hbm.xml:

<query name="QueryContractCountOnWorkStatus">
<![CDATA[
select
ws.workStatusType,count(cd.contractId),ws.workStatusId
from
WorkStatus ws,ContractDetails cd
where
cd.projectId =?
and
ws.workStatusId = * cd.workStatusId

group by ws.workStatusType,ws.workStatusId,ws.statusNew
order by ws.statusNew

]]>
</query>

Exception as follows:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=contractde1_.Work_Status_ID ) group by workstatus0_.Work_Status_Type , worksta' at line 1

Second Try:
<query name="QueryContractCountOnWorkStatus">
<![CDATA[
select
ws.workStatusType,count(cd.contractId),ws.workStatusId
from
ContractDetails cd right join WorkStatus ws
where
cd.projectId =?
and
ws.workStatusId = cd.workStatusId

group by ws.workStatusType,ws.workStatusId,ws.statusNew
order by ws.statusNew

]]>
</query>

Exception as follows:
net.sf.hibernate.QueryException: outer or full join must be followed by path expression

plz urgent... Thanks in Advance


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