0
我們使用的是Spring Boot + Hibernate,其中一個類已經加入了FetchType.EAGER的列。我們想禁用取(簡單地返回空該列),但註釋掉ElementCollection和CollectionTable後,我無法與以下錯誤編譯:在Hibernate上禁用Fetch joinColumn
//@ElementCollection(fetch = FetchType.EAGER)
//@CollectionTable(name = "gsf_locate_request_pth", joinColumns = {@JoinColumn(name = "locate_id")})
@Column(name = "pth_ref")
private Set<Long> payToHoldRefs;
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: gsf_locate_request, for columns: [org.hibernate.mapping.Column(pth_ref)]
是否有反正我可以只是簡單地禁用獲取(而不是懶惰)? – enfany
@enfany不知道。另一種方法是使用投影加載對象。 –