[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5813?page=c...
]
Gail Badner resolved HHH-5813.
------------------------------
Assignee: Gail Badner
Resolution: Rejected
uniqueResult() is intended to remove duplicate objects. It is not intended to remove equal
objects.
From the documentation:
The uniqueResult() method offers a shortcut if you know your query will only return a
single object. Queries that make use of eager fetching of collections usually return
duplicates of the root objects, but with their collections initialized.
org.hibernate.impl.AbstractQueryImpl.uniqueElement() should use
equal()
-----------------------------------------------------------------------
Key: HHH-5813
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5813
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Reporter: Joey Jiang
Assignee: Gail Badner
I think there is a modify in method in uniqueElement of
org.hibernate.impl.AbstractQueryImp.java
Before modify: if ( list.get(i)!=first ) {
After modify: if ( !list.get(i).equals(first)) {
Due the data in list is:
Long 999,
Long 999
i use hibernate-distribution-3.6.0.Final for debug.
Wish you have a good day.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira