Hi,
I have 2 tables Employee and Department. They are connected via a third table Emp_Dept in which employee_Id and department_Id are foreign keys.In hibernate i am managing it through 4 entities.
EmpDeptPK has 2 fields Employee and Department and is an embeddable class.
EmpDept has one field EmpDeptPK as @EmbeddedId.
Employee entity is having
@OneToMany(fetch = FetchType.LAZY)
private Set<EmpDeptc> empDepts = new HashSet<EmpDept>(0);
Now i need to retrieve Employees and their departments if any.
This is my query:
select emp from Employee as emp where emp.employeeName = "abc";
And it is throwing SQLQuery exception saying table employee.employee_employee_Id does not exist.
I think problem is with my mapping. I am using hibernate 3. Any help will be appreciated.
Thanks
Aman Thind
SCJP,SCWCD
JAVA utte mar JAVA,mit JAVA
aman thind
Ranch Hand
Joined: Jun 29, 2007
Posts: 71
posted
0
Found the solution. If anybody wants solution, please message me.