[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5179) Criteria Projections.countDistinct() does not work for composite IDs or components for some dialects

Gail Badner (JIRA) noreply at atlassian.com
Thu Apr 29 19:26:28 EDT 2010


Criteria Projections.countDistinct() does not work for composite IDs or components for some dialects
----------------------------------------------------------------------------------------------------

                 Key: HHH-5179
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5179
             Project: Hibernate Core
          Issue Type: Improvement
          Components: query-criteria
    Affects Versions: 3.5.1
         Environment: hsqldb, mssql
            Reporter: Gail Badner
            Assignee: Gail Badner
            Priority: Minor


Criteria Projections.countDistinct() does not work for composite IDs or compenents if the dialect only supports SELECT COUNT( DISTINCT ... ) with only 1 argument.

According to http://msdn.microsoft.com/en-us/library/ms175997.aspx , a SQL workaround is:

SELECT COUNT(*) FROM (SELECT DISTINCT authorFirstName, authorLastName, authorMiddleName, authorId from Authors) as foo

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