I have a very simple hibernate mapping:
- LegalPerson
- Owner extends LegalPerson
- TabOwner extend Owner
Note that Owner is NOT abstract, so there can be Owner instances and TabOwner instances
They all are mapped using the table-per-sublcass strategy (joined-subclass)
Everyting works very well, but I see that Hibernate makes unneeded outer joins when querieing for Owners:
the HQL 'from Owner' gives the following query (simplified)
select ... from Owner inner join Legal_Person ... LEFT OUTER JOIN Tab_Owner ...
which is correct (the HQL should return all instances of Owner, including subclasses of owner).
but the HQL 'from Owner o where o.class=Owner' still creates an Outer join with Tab_Owner , which is completely unnecessary.
Since we have milions of records on our table, we really want to tune this...
|