Hi all,
I have a domain object with some subclasses. I'm using Table Per Class Hirarchy and have a customized discriminator column and values for the subclasses.
Parent contains:
subclasses contain:Code:static mapping = { tablePerHierarchy true discriminator column:"content_type", value: "basic asset" }
Which works fine and is what I want. However I have a "list" view for the base class which shows all object instances of the parent and any subclass. On this list view I'd like to show a column with the discriminator value I defined in each subclass. I tried several hacks to access it and failed miserably so far. I tried adding fields with the same column as the discriminator and such nasty things.Code:static mapping = { discriminator value: "slide" }
Is there any way to access the discriminator on a domain object instance? Right now I'm using the class property instead, but that contains package information I don't want to have on the view.
Cheers,
Thomas


Reply With Quote