I am using Hibernate 3.2.5 for my application.
I have a Dept.java Employee. Java Association between the two: When I try the following statement: I get the following exception: Please know how to use the inherent login here Reading the doctor, I can not understand what I am missing. You're trying to use a collection like a property you can do instead Are: Dept dept internal join dept.empMap emp from department table and a
employee table
Private Ent DPID; Private string deptName; Private map empMap = new hashmap (); // Gates and Setters
Private Imp. IPID; Private string empName; Private Ent DPID; Personal gaps ages; Private string sex; Department of Private Department; // Gates and Setters
& lt; Map name = "empMap" inverse = "false" cascade = "all" & gt; & Lt; Major column = "DEPT_ID" & gt; & Lt; / Key & gt; & Lt; Map-key formula = "EMP_ID" type = "integer" & gt; & Lt; / Map-key & gt; & Lt; One-to-many classes = "com.jdbc.Employees" /> & Lt; / Map & gt;
query hqlQuery = session.createQuery ("From the Department Department where dept.empMap.empName = 'XYZ '');
org.hibernate.QueryException: dereference collection with reference to element [dept0_.DEPT_ID.empMap] is invalid Effernames [EmpName] [com.jdbc.Dept dept from where dept.empMap.empName = 'XYZ']
where emp.empName = 'XYZ'
No comments:
Post a Comment