I am using Hibernate 3.2.5 for my application.
I have a Dept
table and an Employees
table.
Dept.java
you have this in your mapping:
but there is no such column in your sql between Select
and from
:
session.createSQLQuery("Select d.DEPT_ID, e.EMP_NAME from Dept d,Emp e where d.DEPT_ID = e.DEPT_ID")
Hibernate has no possibilitys to bind the attribute. Try it with this:
session.createSQLQuery("Select d.DEPT_ID, d.DEPT_NAME, e.EMP_NAME from Dept d,Emp e where d.DEPT_ID = e.DEPT_ID")