diff --git a/reference/en/modules/query_hql.xml b/reference/en/modules/query_hql.xml index 61495a5748..7ce2ab2087 100644 --- a/reference/en/modules/query_hql.xml +++ b/reference/en/modules/query_hql.xml @@ -144,14 +144,24 @@ A fetch join does not usually need to assign an alias, because the associated objects should not be used in the where clause (or any other clause). Also, the associated objects are not returned directly in the query results. Instead, they may - be accessed via the parent object. + be accessed via the parent object. The only reason we might need an alias is if we are + recursively join fetching a further collection: + + Note that the fetch construct may not be used in queries called using - scroll() or iterate(). Finally, note that - full join fetch and right join fetch are not - meaningful. + scroll() or iterate(). Nor should fetch + be used together with setMaxResults() or setFirstResult(). + It is possible to create a cartesian product by join fetching more than one collection in a + query, so take care in this case. Join fetching multiple collection roles also sometimes gives + unexpected results for bag mappings, so be careful about how you formulate your queries in this + case. Finally, note that full join fetch and right join fetch + are not meaningful.