Grails 3.0.1 - how and where to configure grails.gorm.default.mapping

点点圈 提交于 2020-01-03 13:29:32

问题


I had in the old Config.groovy:

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

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

So I put this in the additionally application.groovy, but it won't be respected any more. All updates are full, sending all fields to the database, even the not changed ones.

I tried to translate this in application.yml:

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

... but still without luck.


回答1:


With Grails 3.1.10, it works in application.groovy:

dataSource {
  //....
}

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

but had no sucess either while putting it in application.yml



来源:https://stackoverflow.com/questions/29516108/grails-3-0-1-how-and-where-to-configure-grails-gorm-default-mapping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!