4 Replies Latest reply on Feb 14, 2005 7:47 PM by bill.burke

    Preview 3 breaks joined-subclasses?

      I'm having a weird issue, and I'm not sure if it's a bug or if I'm doing something wrong. If it is, let me know and I'll put it into JIRA.

      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

      Any ideas?