Interface CriteriaQuery

  • All Known Implementing Classes:
    CriteriaQueryTranslator

    public interface CriteriaQuery
    An instance of CriteriaQuery is passed to criterion, order and projection instances when actually compiling and executing the query. This interface is not used by application code.
    • Method Detail

      • getColumn

        java.lang.String getColumn​(Criteria criteria,
                                   java.lang.String propertyPath)
                            throws HibernateException
        Resolve a property path to the name of the column it maps to. Ignores projection aliases.
        Parameters:
        criteria - The overall criteria
        propertyPath - The property path to resolve
        Returns:
        The column name
        Throws:
        HibernateException - if the property maps to more than 1 column, or if the property could not be resolved
        See Also:
        getColumns(java.lang.String, org.hibernate.Criteria)
      • getColumns

        java.lang.String[] getColumns​(java.lang.String propertyPath,
                                      Criteria criteria)
                               throws HibernateException
        Resolve a property path to the names of the columns it maps to. Ignores projection aliases
        Parameters:
        criteria - The criteria
        propertyPath - The property path to resolve
        Returns:
        The column names
        Throws:
        HibernateException - if the property maps to more than 1 column, or if the property could not be resolved
      • findColumns

        java.lang.String[] findColumns​(java.lang.String propertyPath,
                                       Criteria criteria)
                                throws HibernateException
        Get the names of the columns mapped by a property path; if the property path is not found in criteria, try the "outer" query. Projection aliases are ignored.
        Parameters:
        criteria - The criteria
        propertyPath - The property path to resolve
        Returns:
        The column names
        Throws:
        HibernateException - if the property could not be resolved
      • getType

        Type getType​(Criteria criteria,
                     java.lang.String propertyPath)
              throws HibernateException
        Get the type of a property path.
        Parameters:
        criteria - The criteria
        propertyPath - The property path to resolve
        Returns:
        The type
        Throws:
        HibernateException - if the property could not be resolved
      • getColumnsUsingProjection

        java.lang.String[] getColumnsUsingProjection​(Criteria criteria,
                                                     java.lang.String propertyPath)
                                              throws HibernateException
        Get the names of the columns mapped by a property path. Here, the property path can refer to a projection alias.
        Parameters:
        criteria - The criteria
        propertyPath - The property path to resolve or projection alias
        Returns:
        The column names
        Throws:
        HibernateException - if the property/alias could not be resolved
      • getTypeUsingProjection

        Type getTypeUsingProjection​(Criteria criteria,
                                    java.lang.String propertyPath)
                             throws HibernateException
        Get the type of a property path. Here, the property path can refer to a projection alias.
        Parameters:
        criteria - The criteria
        propertyPath - The property path to resolve or projection alias
        Returns:
        The type
        Throws:
        HibernateException - if the property/alias could not be resolved
      • getEntityName

        java.lang.String getEntityName​(Criteria criteria)
        Get the entity name of an entity
        Parameters:
        criteria - The criteria
        Returns:
        The entity name
      • getEntityName

        java.lang.String getEntityName​(Criteria criteria,
                                       java.lang.String propertyPath)
        Get the entity name of an entity, taking into account the qualifier of the property path
        Parameters:
        criteria - The criteria
        propertyPath - The property path that (supposedly) references an entity
        Returns:
        The entity name
      • getSQLAlias

        java.lang.String getSQLAlias​(Criteria criteria)
        Get the root table alias of an entity
        Parameters:
        criteria - The criteria
        Returns:
        The SQL table alias for the given criteria
      • getSQLAlias

        java.lang.String getSQLAlias​(Criteria criteria,
                                     java.lang.String propertyPath)
        Get the root table alias of an entity, taking into account the qualifier of the property path
        Parameters:
        criteria - The criteria
        propertyPath - The property path whose SQL alias should be returned.
        Returns:
        The SQL table alias for the given criteria
      • getPropertyName

        java.lang.String getPropertyName​(java.lang.String propertyName)
        Get the property name, given a possibly qualified property name
        Parameters:
        propertyName - The (possibly qualified) property name
        Returns:
        The simple property name
      • getIdentifierColumns

        java.lang.String[] getIdentifierColumns​(Criteria criteria)
        Get the identifier column names of this entity
        Parameters:
        criteria - The criteria
        Returns:
        The identifier column names
      • getIdentifierType

        Type getIdentifierType​(Criteria criteria)
        Get the identifier type of this entity
        Parameters:
        criteria - The criteria
        Returns:
        The identifier type.
      • getTypedIdentifierValue

        TypedValue getTypedIdentifierValue​(Criteria criteria,
                                           java.lang.Object value)
        Build a TypedValue for the given identifier value.
        Parameters:
        criteria - The criteria whose identifier is referenced.
        value - The identifier value
        Returns:
        The TypedValue
      • generateSQLAlias

        java.lang.String generateSQLAlias()
        Generate a unique SQL alias
        Returns:
        The generated alias
      • getForeignKeyType

        default Type getForeignKeyType​(Criteria criteria,
                                       java.lang.String associationPropertyName)
      • getForeignKeyColumns

        default java.lang.String[] getForeignKeyColumns​(Criteria criteria,
                                                        java.lang.String associationPropertyName)
      • getForeignKeyTypeValue

        default TypedValue getForeignKeyTypeValue​(Criteria criteria,
                                                  java.lang.String associationPropertyName,
                                                  java.lang.Object value)