Thanks.
The class hierarchy in my case may have 3 - 5 levels in depth. I am concerned about the performance if using JOINED. The nice thing about Table-per-class is that I can see all properties of a class in a table, and it may perform better than JOINED because of fewer joins.
For table-per-class, To find all instances of a class hierarchy,
EJB QL : select * from base-class.
this will involve:
Union(all tables) order by id
For JOINED, to find all instances of a class hierarchy,
EJB QL: select * from base-class.
this will involve:
select * from base-table joined with all other tables
For treating class hierarchy polymorphically, why JOINED is better than Table-per-class? Thanks.!
|