我在服务器日志"firstResult/maxResults specified with collection fetch;applying in memory!"中收到警告。但是,一切都运行正常。但我不想要这个警告。
我的代码是
public employee find(int id) {
return (employee) getEntityManager().createQuery(QUERY).setParameter("id", id).getSingleResult();
}
我的问题是
QUERY = "from employee as emp left join fetch emp.salary left join fetch emp.department where emp.id = :id"
https://stackoverflow.com/questions/11431670
复制相似问题