开发者

How to do join fetching instead of select fectching with EclipseLink?

开发者 https://www.devze.com 2023-02-03 19:57 出处:网络
I\'ve got a OneToOne relation between two entities. This relation is eager by defa开发者_高级运维ult, but when logging requests, I only see multiple selects, no join appears. Same thing when forcing e

I've got a OneToOne relation between two entities. This relation is eager by defa开发者_高级运维ult, but when logging requests, I only see multiple selects, no join appears. Same thing when forcing eager.

Do you know how to tell eclipselink to use join fetching (like @Fetch(JOIN) in hibernate) ?

Thanks


@JoinFetch

or,

@JoinFetch(JoinFetchType.OUTER)

you can also use,

@BatchFetch

See, http://java-persistence-performance.blogspot.com/2010/08/batch-fetching-optimizing-object-graph.html

You can also set both of these through Query hints instead of always having it enabled.

0

精彩评论

暂无评论...
验证码 换一张
取 消