如何进行连接提取而不是使用EclipseLink选择fectching? [英] How to do join fetching instead of select fectching with EclipseLink?

查看:225
本文介绍了如何进行连接提取而不是使用EclipseLink选择fectching?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在两个实体之间有一个 OneToOne 关系。默认情况下,这种关系很急切,但在记录请求时,我只会看到多次选择,不会出现连接。强迫渴望时也一样。

I've got a OneToOne relation between two entities. This relation is eager by default, but when logging requests, I only see multiple selects, no join appears. Same thing when forcing eager.

你知道如何告诉eclipselink使用连接提取(如hibernate中的@Fetch(JOIN))?

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

谢谢

推荐答案

@JoinFetch

@JoinFetch

或者,

@JoinFetch(JoinFetchType.OUTER)

@JoinFetch(JoinFetchType.OUTER)

你也可以使用,

@BatchFetch

@BatchFetch

参见,
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.

这篇关于如何进行连接提取而不是使用EclipseLink选择fectching?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆