接口 CriteriaQuery

  • 所有已知实现类:
    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.
    作者:
    Gavin King
    • 方法详细资料

      • getColumns

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

        String[] findColumns​(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.
        参数:
        criteria - The criteria
        propertyPath - The property path to resolve
        返回:
        The column names
        抛出:
        HibernateException - if the property could not be resolved
      • getType

        Type getType​(Criteria criteria,
                     String propertyPath)
              throws HibernateException
        Get the type of a property path.
        参数:
        criteria - The criteria
        propertyPath - The property path to resolve
        返回:
        The type
        抛出:
        HibernateException - if the property could not be resolved
      • getColumnsUsingProjection

        String[] getColumnsUsingProjection​(Criteria criteria,
                                           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.
        参数:
        criteria - The criteria
        propertyPath - The property path to resolve or projection alias
        返回:
        The column names
        抛出:
        HibernateException - if the property/alias could not be resolved
      • getTypeUsingProjection

        Type getTypeUsingProjection​(Criteria criteria,
                                    String propertyPath)
                             throws HibernateException
        Get the type of a property path. Here, the property path can refer to a projection alias.
        参数:
        criteria - The criteria
        propertyPath - The property path to resolve or projection alias
        返回:
        The type
        抛出:
        HibernateException - if the property/alias could not be resolved
      • getEntityName

        String getEntityName​(Criteria criteria)
        Get the entity name of an entity
        参数:
        criteria - The criteria
        返回:
        The entity name
      • getEntityName

        String getEntityName​(Criteria criteria,
                             String propertyPath)
        Get the entity name of an entity, taking into account the qualifier of the property path
        参数:
        criteria - The criteria
        propertyPath - The property path that (supposedly) references an entity
        返回:
        The entity name
      • getSQLAlias

        String getSQLAlias​(Criteria criteria)
        Get the root table alias of an entity
        参数:
        criteria - The criteria
        返回:
        The SQL table alias for the given criteria
      • getSQLAlias

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

        String getPropertyName​(String propertyName)
        Get the property name, given a possibly qualified property name
        参数:
        propertyName - The (possibly qualified) property name
        返回:
        The simple property name
      • getIdentifierColumns

        String[] getIdentifierColumns​(Criteria criteria)
        Get the identifier column names of this entity
        参数:
        criteria - The criteria
        返回:
        The identifier column names
      • getIdentifierType

        Type getIdentifierType​(Criteria criteria)
        Get the identifier type of this entity
        参数:
        criteria - The criteria
        返回:
        The identifier type.
      • getTypedIdentifierValue

        TypedValue getTypedIdentifierValue​(Criteria criteria,
                                           Object value)
        Build a TypedValue for the given identifier value.
        参数:
        criteria - The criteria whose identifier is referenced.
        value - The identifier value
        返回:
        The TypedValue
      • generateSQLAlias

        String generateSQLAlias()
        Generate a unique SQL alias
        返回:
        The generated alias