Hi,
i'm quite new to Hibernate, and after reading Chapter 11 from the Hibernate documentation, i wonder if Hibernate also supports "deep eager loading".
I want to read a net of objects starting from root object as fast as possible.
From my experience the performance of such a reading is (as a first approximation) direct proportional to the number of SQL requests (=number of DB roundtrips).
Therefore, i would like that only one SQL select is performed per table, regardless of how the various entries in a table are connected to their parents.
Example:
Let's assume we have four entities:
event,
order,
ticket and
promotion_logo
An event has n1 order's, a order has n2 ticket's, and a ticket points to any number of promotion_logo's.
In a concrete case, an event has n1=3 orders, each order has n2=3/4/2 tickets and the various tickets point to 0..4 promotion_logo entries.
Some O/R mapper i know of optimze the reading of relationships only at "level 1", so it generates 14 SQL statements (1 to read the event, 1 to read the orders, 3 to read the tickets for each order and 9 to read the promotion_logo's for each ticket).
Obviously, you could do the same in 4 SQL select statements, one for each table.
Can i instruct Hibernate to do a "deep eager loading"?
Bye,
J