简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM