开发者

How do you turn off hibernate lazy loading for all domain classes in grails?

The question states what I want to do. I have a bunch of classes with attributes annotated with JAXB annotations, and the results are coming bac开发者_如何转开发k blank because of lazy loading I think.


I know there are gorm.default.mappings but I see nothing documented for setting the property you want

I know you can brute force it this way

// DataSource.groovy
hibernate {
    max_fetch_depth=0
}

But I believe overall it is better to leave the configuration the way it is. I can explain it but this question/response covers it and it already typed up


Well, simply use fetchType=EAGER

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜