0

A question like what I need is asked here but it's answer is not satisfying what I need. I have classes like this :

abstract class A{
   String a
}
class B extends A{
   String b
}
class C extends A{
   String c
}

I want to have a table for each class, so I add tablePerHierarchy and set it false like this:

abstract class A{
   String a
   static mapping = {
       tablePerHierarchy false
   }
}

but when I run the program and it creates a database there are no discriminator, and I want to query table A and find out if it is B, or C? How Could I add discriminator to this strategy?

Community
  • 1
  • 1
Lrrr
  • 4,755
  • 5
  • 41
  • 63

1 Answers1

1

It is not supported based on the bug report.

Lrrr
  • 4,755
  • 5
  • 41
  • 63
Divick
  • 1,213
  • 1
  • 20
  • 44
  • 1
    Thanks, although it is an old post, and I'm currently not working on grails, but it is a good reference for others in future :) – Lrrr Feb 17 '15 at 06:09