]
Anton Mostovoy moved WEBSITE-7 to HHH-6628:
-------------------------------------------
Workflow: Expanded Workflow (was: jira)
Issue Type: Bug (was: Improvement)
Key: HHH-6628 (was: WEBSITE-7)
Project: Hibernate Core (was: Hibernate Website)
HQL doc about setMaxResults and use of "join fetch" is
confusing
----------------------------------------------------------------
Key: HHH-6628
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6628
Project: Hibernate Core
Issue Type: Bug
Reporter: Anton Mostovoy
Priority: Minor
The current [HQL
documentation|http://docs.jboss.org/hibernate/core/3.6/reference/en-US/ht...]
states:
"The fetch construct cannot be used in queries called using iterate() (though
scroll() can be used). Fetch should be used together with setMaxResults() or
setFirstResult(), as these operations are based on the result rows which usually contain
duplicates for eager collection fetching, hence, the number of rows is not what you would
expect. Fetch should also not be used together with impromptu with condition."
Test shows that in 3.6.5, setMaxResults() works correctly when "left join
fetch" is used (although it appears to use client side limit, instead of
'rownum' in the sql query). Therefore, I believe the sentence about setMaxResults
is very confusion and should be removed.
In docs for 3.2, it read "Note that the fetch construct may not be used in queries
called using iterate() (though scroll() can be used). Nor should fetch be used together
with setMaxResults() or setFirstResult() as these operations are based on the result rows,
which usually contain duplicates for eager collection fetching, hence, the number of rows
is not what you'd expect. "
--
This message is automatically generated by JIRA.
For more information on JIRA, see: