[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3206) criteria.uniqueResult() is null when criteria.firstResult is NOT null when projection is count

Gail Badner (JIRA) noreply at atlassian.com
Tue Sep 1 18:21:15 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33883#action_33883 ] 

Gail Badner commented on HHH-3206:
----------------------------------

Please attach a runnable unit test (Java + mapping) to reproduce this issue.

> criteria.uniqueResult() is null when criteria.firstResult is NOT null when projection is count
> ----------------------------------------------------------------------------------------------
>
>                 Key: HHH-3206
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3206
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.2.5
>         Environment: JBoss 4.0/JDK 1.6/Oracle 10g
>            Reporter: Will Hoover
>            Priority: Minor
>   Original Estimate: 1 week
>  Remaining Estimate: 1 week
>
> SYNOPSIS:
> "criteria.uniqueResult()" is null when criteria.firstResult is NOT null when projection is count. This happens regardless if using "criteria.setProjection(Projections.countDistinct(distinctPropertyName));" or "criteria.setProjection(Projections.rowCount())".
> The reason why the criterias firstResult is not null is because we are reusing the same criteria to perform "criteria.list()" as "criteria.uniqueResult()" to avoid having to set all of the same restrictions etc. twice.

-- 
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list