scesbron wrote:
So why do you want to set inheritance in hbm files ?
You can have inheritance in java but not specify it in hibernate. Thus this classes are not correlated
But these classes are correlated. Child class should have something from the Base class, also it has to introduce something own. And Child class should behave like a base in some cases.
Furthermore they have to share at least the id column to save the existing relationships of the Base class with other classes.
I figured out that when hibernate querying for Base class, it usesleft outer join to the Child class. Thats why it fetches all records from the Base table.
And I need to specify somehow that when querying for a Base class, it needs to check the Child table. Or it should be specified for a Child class, not to fetch it, until the explicit query will ask for it.
But I don't know how to specify such kind of limitation.