7

我在旧的 Config.groovy 中:

grails.gorm.default.mapping = {
    id generator = 'identity'

    // send only the dirty fields to the database for updating
    dynamicUpdate = true
    dynamicInsert = true
}

所以我把它放在另外的application.groovy中,但它不会再被尊重了。所有更新都是完整的,将所有字段发送到数据库,即使是未更改的字段。

我试图在 application.yml 中翻译这个:

grails:
    gorm:
        default:
            mapping:
                id generator:  "identity"
                dynamicUpdate: true
                dynamicInsert: true

...但仍然没有运气。

4

1 回答 1

2

使用 Grails 3.1.10,它可以在 application.groovy 中运行:

dataSource {
  //....
}

grails.gorm.default.mapping = {
    uuid index:'idx_uuid', type: org.hibernate.type.UUIDCharType, length: 36, defaultValue: null
    batchSize 15000
}

但在将其放入 application.yml 时也没有成功

于 2016-09-29T09:39:49.980 回答