0
定義FetchType可以說我有關係的其他實體的實體,其中FetchType定義急於的EclipseLink - 在運行
class Entity {
@OneToOne(fetch=FetchType.EAGER)
@JoinColumn(name="user_profile_id")
private OtherEntity otherEntity;
}
該實體在不同的服務和一些對服務FetchType.EAGER
的使用OtherEntity
是我想要的,但是在其他一些服務中,我會很樂意將FetchType
更改爲FetchType.LAZY
,但是在我的實體類中,我已經在OtherEntity
上將FetchType
定義爲`EAGER。
所以問題是:有沒有辦法在運行時定義FetchType
?
謝謝,歡呼聲