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
|