开发者

For lazy relationship how to specify a fetch join that can force a eager loading in JPA?

@Entity
public EntityA implements Serializable {
    ...
    @OneToOne(fetch=FetchType.LAZY)
    private Entity开发者_高级运维B b;
    ...
}

How do i dynamically load the EntityB eagerly?


Using a query:

select a from EntityA a left join fetch a.b where a.id = :id
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜