Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 263
rawi Avatar asked Apr 08 '15 13:04

rawi


1 Answers

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

like image 178
Louis GRIGNON Avatar answered Sep 28 '22 23:09

Louis GRIGNON