I want to create 3 separate tables for 3 domain classes: A, B extends A, C extends B But I want their tables to be NOT connected to each other.
In hibernate, I would use InheritanceType.TABLE_PER_CLASS, in grails, what would be the equivalent?
I want to create 3 separate tables for 3 domain classes: A, B extends A, C extends B But I want their tables to be NOT connected to each other.
In hibernate, I would use InheritanceType.TABLE_PER_CLASS, in grails, what would be the equivalent?
Something I was trying to also achieve and yes it is possible with grails, it is a case of bending the spoon a little to achieve it:
Doing this under grails 3
You have a base class that you wish to extend and have child tables that have identical fields i.e. TABLE_PER_CLASS:
I found another post that helped and there was a comment but to now expand and explain it correctly on this post:
This would have been our base domain class but instead of creating it in
grails-app/domains/
it is created undersrc/main/groovy/test
Next out actual domain classes in
grails-app/domains/test
:and
Looking at mysql:
Try to use tablePerHierarchy false
See more : http://grails.org/doc/latest/guide/single.html#5.5.2.3%20Inheritance%20Strategies