i have two entity classes both are in relation.am skipping annoatation part and remaining fields in the below code.
class Employee{
Department department;
}
class Department{
String departmentName;
}
when i try to access departmentName in native sql query am getting error unknown column.
query is
select * from employee where employee.department.departmentname=?;
how can i access child class entities? some one please help me.
Native query as the name suggest is pure SQL dialect of the underlying db server and has nothing to do with HQL/JPQL. You have to use JOIN with actual tables and column names.