【问题标题】:groovy / grails / hibernate - configure set to be fetched eagerlygroovy / grails / hibernate - 配置设置为急切地获取
【发布时间】:2010-09-09 18:34:24
【问题描述】:

我们正在使用域类通过 grails 配置休眠。补充:

static hasMany = [image:Image]

static fetchMode = [image:"eager"]

但是,当我拉出对象图时,不会加载每个图像。请指教。

谢谢。

【问题讨论】:

    标签: hibernate grails groovy eager-loading fetch


    【解决方案1】:

    您似乎在使用1.0.x configuration style。 看看documentation

    试试

    class Collage {
        static hasMany = [image:Image]
        static mapping = {
            image lazy: false
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-17
      • 2012-03-26
      相关资源
      最近更新 更多