Subclass schema mapping with tablePerHierarchy false
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
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
Contributor guide
Research direction
Start by reproducing the SchoolYear and SchoolYearRegular mappings with tablePerHierarchy false on the stated Grails, GORM, Gradle, and PostgreSQL versions. Investigate how the subclass table schema is resolved; done means the subclass query uses the agis schema and no longer reports that school_year_regular does not exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100