JOIN element in hbm for Generatlized Relationship

Do we get element in hbm-XML of base class for every generalized(inheritence) relationship in ORM ? or it comes only if the mapped tables are different (i.e. with referential integrety)?

If yes , then what would happen if both base class and derived class are mapped to same table?

ClassBase ---------------------- table1
DerivedClass ----------------------- table1




Hello Santm,

The element in hbm.xml is depends on how you specify the inheritance strategy in the class hierarchy. It only be generated if you are using table per sub-class strategy together with the discriminator column defined. Since using table per sub-class strategy already no need to have the discriminator column. May I know why you would like to generate the ?

Best regards,
Rain Wong

Infact we dont want JOIN because this JOIN tries to search for foreign key and in our design we have both base class and derived class mapped to same table. Yes our derived class inheritence strategy is ‘table per class’ Hierarchy and the derived class is ‘table per subclass’ hierarchy.

As per your documentation, we suppose that derived class should be table per class because we have only one table. However when we try generating code with base class as ‘table per class’ & also derived class as ‘table per class’ we are getting errors that asks to ‘syncronise derived class with ERD’

please help.