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

Steve Ebersole (JIRA) noreply at atlassian.com
Fri Jul 16 15:20:14 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-4957.
-------------------------------


> 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, 3.5.1
>         Environment: Hibernate: 3.5.0-CR-2
> OS: Windows XP (should be OS independent)
> IDE: Eclipse 3.5 Galileo
>            Reporter: Olaf Muliawan
>            Assignee: Gail Badner
>            Priority: Blocker
>             Fix For: 3.5.2, 3.6
>
>         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