In my script I'm using
implementation 'org.grails:grails-datastore-gorm-hibernate5:8.0.1'
and initialize the domain classes with
Map config = new YamlSlurper().parse( getClass().getResourceAsStream( '/application.yml' ) )
new HibernateDatastore( config.gorm, classes as Class[] )
Now I want to provide some default values to each Entity's mapping as per ref-doc by adding the code to src/main/resources/application.groovy:
grails.gorm.default.mapping = {
id column:'o_id'
version column:'chng_id'
lastUpdated column:'upd'
}
The file is ignored though, and no default mappings are applied.
What is the proper way to apply the default mappings in a GORM standalone setup?
I ended up with the following setup:, putting the GORM default mapping into the initializer class:
and
application.ymlThe only gotcha here is, that in none of the domain classes the fields from
MAPPINGmust be present!