Batch Fetch is not working in EclipseLink

微笑、不失礼 提交于 2019-12-06 07:27:25

The batch fetch hint tells EclipseLink to use batching when it fetches the relationship, but doesn't influence when to fetch. Because the relationship is marked as lazy, it still waits for the relationship to be accessed, but when it does, it will use a batch query to return all associated entities for all Employee's brought in through the initial query. Join fetch is immediate because the information is brought in with the initial query, so there is no value in putting indirection in between.

If you want to load the relationship immediately, use

query.setHint(QueryHints.LOAD_GROUP_ATTRIBUTE, "addresses");
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!