如何通过jpa注释确定嵌套对象List的运行时获取类型(Eager/Lazy),

Pra*_*ngh 2 java spring hibernate

我通过hibernate注释(@FetchProfile)实现了这个功能,但现在我想用JPA来实现.有什么办法吗?

Ric*_*lla 6

使用JPA 2.1 Entity Graph您可以在运行时控制提取,请查看此博客此博客以获取更多详细信息.