Uploaded image for project: 'Hibernate ORM'
  1. HHH-5179

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.5.1
    • Fix Version/s: None
    • Component/s: query-criteria
    • Labels:
      None
    • Environment:
      hsqldb, mssql
    • Last commented by a user?:
      true
    • Sprint:

      Description

      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

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                gbadner Gail Badner
                Reporter:
                gbadner Gail Badner
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: