Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.2.2
Mapping documents:
Training.xml
<hibernate-mapping>
<class name="TrainingHB" table="TRAINING">
<id column="TRNG_ID" name="trngId" length="64" type="java.lang.String"></id>
<property column="TRNG_TRAINEE_ID" length="64" name="traineeId" not-null="true" type="java.lang.String"/>
<property column="TRNG_TRAINED_NODE_ID" length="64" name="trainedNodeId" not-null="true" type="java.lang.String"/>
</class>
</hibernate-mapping>
EmployeeWorkDetails.xml
<hibernate-mapping>
<class name="EmployeeWorkDetailsHB" table="EMPLOYEE_WORK_DETAILS">
<id column="EWD_ID" name="ewdId" length="64" type="java.lang.String"></id>
<property column="EWD_EMP_ID" length="64" name="empId" not-null="true" type="java.lang.String"/>
<property column="EWD_SHIFT_ID" length="64" name="shiftId" type="java.lang.String"/>
</class>
</hibernate-mapping>
Station.xml
<hibernate-mapping>
<class name="com.visiontss.muis.model.hb.StationHB" table="STATION">
<id column="STN_ID" name="stnId" length="64" type="java.lang.String"></id>
<property column="STN_NODE_ID" length="64" name="nodeId" not-null="true" type="java.lang.String"/>
<property column="STN_NAME" length="64" name="name" not-null="true" type="java.lang.String"/>
<property column="STN_TRAINING_FLEX_INDEX" name="trainingFlexIndex" type="int"/>
</class>
</hibernate-mapping>
Node.xml
<hibernate-mapping >
<class name="NodeHB" table="Node">
<id column="NODE_ID" name="nodeId" length="64" type="java.lang.String" />
<property column="NODE_PARENT_NODE_ID" length="64" name="parentNodeId" not-null="true" type="java.lang.String"/>
<property column="NODE_NAME" length="64" name="nodeName" not-null="true" type="java.lang.String"/>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
query= "select count(t.trainedNodeId), n.name, s.trainingFlexIndex"
+ " from StationHB s left outer join TrainingHB t"
+ " with s.nodeId = t.trainedNodeId"
+ " inner join NodeHB n"
+ " with n.nodeId = s.nodeId"
+ " left outer join EmployeeWorkDetailsHB ewd"
+ " and ewd.empId=t.traineeId"
+ " group by t.trainedNodeId,n.name,s.trainingFlexIndex"
+ " having (count(t.trainedNodeId)-s.trainingFlexIndex<=0) ";
Full stack trace of any exception that occurs:
[3/29/08 11:36:05:969 IST] 00000029 PARSER E Path expected for join!
[3/29/08 11:36:06:000 IST] 00000029 PARSER E Path expected for join!
[3/29/08 11:36:06:109 IST] 00000029 PARSER E Invalid path: 't.trainedNodeId'
[3/29/08 11:36:06:156 IST] 00000029 PARSER E Invalid path: 'n.name'
[3/29/08 11:36:06:203 IST] 00000029 PARSER E Invalid path: 't.trainedNodeId'
[3/29/08 11:36:06:234 IST] 00000029 PARSER E Invalid path: 't.trainedNodeId'
Name and version of the database you are using:
IBM DB2 UDB (8.1)
The generated SQL (show_sql=true):NIL
Debug level Hibernate log excerpt:NIL
Problems with Session and transaction handling? NO
Read this:
http://hibernate.org/42.html
I am working in Hibernate for the past 4 months. Need some guidance how to apply the Outer joins in HQL.
If any piece of sample code will help me to understand better
Thanks
Raji.T