Details
-
Bug
-
Resolution: Done
-
Major
-
Preview 3
-
None
-
None
Description
In short, the problem is that the @Table annotation is ignored in subclasses when using the JOINED strategy.
Best described by example. Take three classes: Account, BillingAccount, and ProductAccount. The latter two classes inherit from the first class using the JOINED strategy. All three classes also have a @Table annotation to specify the table name. In the case of the class "Account", the table name is "accounts". In the case of the class "BillingAccount", the table name is "accounts_billing" and in the case of the class "ProductAccount", the table name is "accounts_products".
The problem is seen in this output from the server log. Notice that the @Table attribute is honored for the superclass, but ignored for the subclasses (instead, the default table name, which is the same as the class name, is used).
15:04:38,096 INFO [HbmBinder] Mapping class: Account -> accounts
15:04:38,100 INFO [HbmBinder] Mapping joined-subclass: ProductAccount -> ProductAccount
15:04:38,103 INFO [HbmBinder] Mapping joined-subclass: BillingAccount -> BillingAccount