[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4957) Criteria Projections.countDistinct() function broken

Gail Badner (JIRA) noreply at atlassian.com
Tue Apr 20 03:10:24 EDT 2010


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

Gail Badner commented on HHH-4957:
----------------------------------

Is this still an issue in 3.5.1?

> Criteria Projections.countDistinct() function broken
> ----------------------------------------------------
>
>                 Key: HHH-4957
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4957
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0-CR-2
>         Environment: Hibernate: 3.5.0-CR-2
> OS: Windows XP (should be OS independent)
> IDE: Eclipse 3.5 Galileo
>            Reporter: Olaf Muliawan
>            Priority: Blocker
>         Attachments: HibernateCriteriaDistinctCount.zip
>
>
> The criteria countDistinct() does not generate the correct query:
> criteria.setProjection(Projections.countDistinct("id"));
> generates: select count(id)
> instead of: select count(distinct id)
> This used to work in version 3.3.2-GA with toSqlString(). This method is missing in 3.5.0
> Working version in 3.3.2-GA: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/trunk/core/src/main/java/org/hibernate/criterion/CountProjection.java?revision=14993&view=markup
> Broken version in 3.5.0: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/trunk/core/src/main/java/org/hibernate/criterion/CountProjection.java?revision=17874&view=markup
> See also the forum thread: http://forum.hibernate.org/viewtopic.php?f=1&t=1002910

-- 
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