I'm developing a plugin that needs a specific index configuration in table mapping.
static mapping = {
myProperty index:'myProperty_Idx'
}
Is it some way to let plugin users decide if they want to use or not this mapping via Config.groovy file?
I believe you can read the config variables right from your mapping block.
So this line in the app consuming your plugin's Config.groovy
grails.myplugin.useIndexForFoo = true
Should allow you to have a configurable domain class, such as
Note I have used Holders rather than injecting grailsApplication bean because mapping config is static - do not know if this is optimal or not