Quote:
Would creating a TO (POJO) from about 22 tables with Hibernate and joins be the most efficient way?
It depends how you are using the data. If you need to read a whole object it will be as efficient as creating 22 joins on tables on select.
If you select object and work on certain table only - hibernate offers you fetch="select" property - this allows you to load base tables and when used load the tables that are needed. This works fine if you load an object and work on it.
I am not sure how does the update work whether it updates the data that was changed. I assume so but I have not checked it - you may ask others or write a simple test.
Anyway from my experience loading the data from too many joined tables is a bottle neck, and does not sound like a good idea. Depending on how you are using this data maybe the Oracle's materialized view will be a better idea?
Lukasz