@Basic(fetch = FetchType.LAZY) does not work?

前端 未结 7 1643
执念已碎
执念已碎 2020-12-17 09:17

I use JPA (Hibernate) with Spring. When i want to lazy load a Stirng property i use this syntax:

@Lob
@Basic(fetch = FetchType.LAZY)
public String getHtmlSum         


        
7条回答
  •  不思量自难忘°
    2020-12-17 09:43

    Lazy Lob loading would require bytecode instrumentation to work properly, so it is not available by default in any JPA implementation I'm aware of.

    Your best bet is to put the Lob into a separate entity, like HtmlSummary, and use a lazily loaded one-to-one association.

提交回复
热议问题