首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何避免出现警告"firstResult/maxResults specified with collection fetch;applying in memory!“什么时候使用Hibernate?

如何避免出现警告"firstResult/maxResults specified with collection fetch;applying in memory!“什么时候使用Hibernate?
EN

Stack Overflow用户
提问于 2012-07-11 19:28:31
回答 7查看 51.7K关注 0票数 42

我在服务器日志"firstResult/maxResults specified with collection fetch;applying in memory!"中收到警告。但是,一切都运行正常。但我不想要这个警告。

我的代码是

代码语言:javascript
复制
public employee find(int id) {
    return (employee) getEntityManager().createQuery(QUERY).setParameter("id", id).getSingleResult();
}

我的问题是

代码语言:javascript
复制
QUERY = "from employee as emp left join fetch emp.salary left join fetch emp.department where emp.id = :id"
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11431670

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档