Community
Participate
Working Groups
Build Identifier: M20110909-1335 With JOINED inheritance strategy, if just applying Multitenant annotation to the subentity, an error message complaining the default tenant discriminator column <"the tenant discriminator column defined on the super entity"> cannot be resolved on the table of the subentity will be given. It seems to try to pull the tenant discriminator column from the super entity, which is incorrect. We should not give error with this case. The use case likes @Entity @Multitenant(MultitenantType.SINGLE_TABLE) @TenantDiscriminatorColumn(name="FOO_ID") @Inheritance(strategy = JOINED) @DiscriminatorColumn(name = "GENDER") public class Foo extends SuperFoo implements Serializable { ... ... } @Entity @Multitenant(MultitenantType.SINGLE_TABLE) // error is given here @Table(name = "FOO2") @PrimaryKeyJoinColumn(name = "FOO2_ID", referencedColumnName = "FOO_ID") public class SubFoo extends Foo implements Serializable { ... ... } Reproducible: Always
The error message is given without even applying Multitenant annotation to the subentity.
If specifying table attribute for the tenant discriminator column(s) defined in the super entity, the error message will be gone.
I fixed this by not validating the default tenant discriminator columns in this case. They will be validated on the root entity, where any problems can be fixed.