gorm-hibernate5 icon indicating copy to clipboard operation
gorm-hibernate5 copied to clipboard

Subclass schema mapping with tablePerHierarchy false

Open rodolfosaraiva opened this issue 3 years ago • 0 comments

When using tablePerHierarchy false, i lost subclass schema mapping and consequently, get this error:

Caused by: org.postgresql.util.PSQLException: ERROR: relation "school_year_regular" does not exist

class SchoolYear {
   ...
    static mapping = {
        table schema: 'agis'
        discriminator column: "type"
        tablePerHierarchy false
    }
}
class SchoolYearRegular extends SchoolYear {
   ...
    static mapping = {
        table schema: 'agis'
        discriminator "Regular"
    }
}

Environment Information

grailsVersion=4.0.8 gormVersion=7.0.4 gradleWrapperVersion=5.6.4

rodolfosaraiva avatar May 13 '21 21:05 rodolfosaraiva