| Summary: | [Multi-Tenancy] Invalid validation against default tenant discriminator column on subentity with JOINED strategy | ||
|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Nan Li <nan.n.li> |
| Component: | JPA | Assignee: | Karen Butzke <karenfbutzke> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | karenfbutzke |
| Version: | unspecified | ||
| Target Milestone: | 3.1 M3 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | EclipseLink | ||
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. |
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