I have a class like this:
class Apple extends Fruit {
static mapping = {
discriminator "AppleType"
}
}
Is there any way to get this discriminator value in the controller/view?
You can check the mapping of your domain class with the Mapping class. Example:
def mapping = GrailsDomainBinder.getMapping(Apple)
println mapping.discriminator