我有一个子查询
select *
from Employee
where employeeId in (
select employeeId
from dept as x
where x.name ='Dept1'
and x.category ='category1'
and x.employeeId IN (
select employeeId
from dept as x
where x.name ='Dept2'
and x.category ='category2'))
我想选择返回列表作为员工POJO对象。
我正在使用hibernate。
由于
答案 0 :(得分:0)
以下代码对我有用。
session.createSQLQuery(query).
addEntity("employee",Employee.class).
setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).
list();
由于