I am using Hibernate 4.3.5 and basically running into the following problem with the query:
Query query = session.createQuery("FROM "
+ " EmployeeProp cp JOIN Db db ON "
+ "(db.dbId = cp.value ) WHERE cp.typeId=11111 AND cp.employeeId=12345 ");
Where EmployeeProp
is an entity.
Db
is an entity.
I keep getting the following error:
org.hibernate.hql.internal.ast.QuerySyntaxException: Path expected for join! [FROM abc.def.package.orm.EmployeeProp cp JOIN Db db ON (db.dbId = cp.value ) WHERE cp.typeId=11111 AND cp.employeeId=12345 ]
And this is the SQL I have which I am trying to use in the HQL above:
SELECT * FROM employeeProp
JOIN db ON (db.db_id=employeeProp.value)
WHERE type_id=11111 and employeeProp.employee_id=12345;
P.S. I am new to Hibernate