The Hibernate In Action book mentions a limit of one eagerly fetched collection for a single query. I have a few questions regarding this limitation:
1) Is that on a "per entity" basis? For example, Entity A has a to-many relation to B which has a to-many relation to C. Is it possible to fetch the entire A->B->C subgraph in a single query? Even though you have a large flattened result set, it still seems significantly faster in many cases to execute a single query as opposed to executing a separate query to retrieve C for each element B. Obviously, this assumes that the application knows for sure it will need to traverse the entire sub-graph.
If the restriction is per entity, I would think it means that if A has a to-many association to B and A also has a to-many association to C, that A can only eagerly fetch one of those two associations (not both) in a single query.
2) The book also metions these contraints might be lifted in future versions. We are planning to use Hibernate 3.0 with production deployment late next year. Is this still a constraint in 3.0?
-Aaron
|