How to override FetchType.EAGER to be lazy at runtime

后端 未结 2 1737
闹比i
闹比i 2021-01-04 12:08

Using the JPA EntityManager and the JPA Query object, how can I override something that has the annotation @OneToMany(fetch = FetchType.EAGER) to be fetched lazily in a quer

2条回答
  •  感情败类
    2021-01-04 12:33

    Look into Hibernate Fetch profiles, or JPA Entity Graphs. This problem has been solved since you've asked the question in 2012.

提交回复
热议问题