Class Distinct

    • Constructor Detail

      • Distinct

        public Distinct​(Projection wrappedProjection)
        Constructs a Distinct
        Parameters:
        wrappedProjection - The wrapped projection
    • Method Detail

      • toSqlString

        public java.lang.String toSqlString​(Criteria criteria,
                                            int position,
                                            CriteriaQuery criteriaQuery)
        Description copied from interface: Projection
        Render the SQL fragment to be used in the SELECT clause.
        Specified by:
        toSqlString in interface Projection
        Parameters:
        criteria - The local criteria to which this project is attached (for resolution).
        position - The number of columns rendered in the SELECT clause before this projection. Generally speaking this is useful to ensure uniqueness of the individual columns aliases.
        criteriaQuery - The overall criteria query instance.
        Returns:
        The SQL fragment to plug into the SELECT
      • toGroupSqlString

        public java.lang.String toGroupSqlString​(Criteria criteria,
                                                 CriteriaQuery criteriaQuery)
        Description copied from interface: Projection
        Render the SQL fragment to be used in the GROUP BY clause
        Specified by:
        toGroupSqlString in interface Projection
        Parameters:
        criteria - The local criteria to which this project is attached (for resolution).
        criteriaQuery - The overall criteria query instance.
        Returns:
        The SQL fragment to plug into the GROUP BY
      • getTypes

        public Type[] getTypes​(Criteria criteria,
                               CriteriaQuery criteriaQuery)
        Description copied from interface: Projection
        Types returned by the rendered SQL fragment. In other words what are the types that would represent the values this projection asked to be pulled into the result set?
        Specified by:
        getTypes in interface Projection
        Parameters:
        criteria - The local criteria to which this project is attached (for resolution).
        criteriaQuery - The overall criteria query instance.
        Returns:
        The return types.
      • getTypes

        public Type[] getTypes​(java.lang.String alias,
                               Criteria criteria,
                               CriteriaQuery criteriaQuery)
        Description copied from interface: Projection
        Get the return types for a particular user-visible alias.

        Differs from Projection.getTypes(org.hibernate.Criteria, CriteriaQuery) in that here we are only interested in the types related to the given criteria-level alias.

        Specified by:
        getTypes in interface Projection
        Parameters:
        alias - The criteria-level alias for which to find types.
        criteria - The local criteria to which this project is attached (for resolution).
        criteriaQuery - The overall criteria query instance.
        Returns:
        The return types; expected to return null if this projection does not understand this alias.
      • getAliases

        public java.lang.String[] getAliases()
        Description copied from interface: Projection
        Get the criteria-level aliases for this projection (ie. the ones that will be passed to the ResultTransformer)
        Specified by:
        getAliases in interface Projection
        Returns:
        The aliases
      • isGrouped

        public boolean isGrouped()
        Description copied from interface: Projection
        Is this projection fragment (SELECT clause) also part of the GROUP BY
        Specified by:
        isGrouped in interface Projection
        Returns:
        True if the projection is also part of the GROUP BY; false otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object