Interface FromBaseBuilder<X extends FromBaseBuilder<X>>

    • Method Detail

      • from

        X from​(Class<?> entityClass)
        Like from(Class, String) with the alias equivalent to the camel cased result of what Class.getSimpleName() of the entity class returns.
        Parameters:
        entityClass - The entity class which should be queried
        Returns:
        The query builder for chaining calls
      • from

        X from​(Class<?> entityClass,
               String alias)
        Sets the entity class on which the query should be based on with the given alias.
        Parameters:
        entityClass - The entity class which should be queried
        alias - The alias for the entity
        Returns:
        The query builder for chaining calls
      • from

        X from​(javax.persistence.metamodel.EntityType<?> entityType)
        Like from(EntityType, String) with the alias equivalent to the camel cased result of what EntityType.getName() of the entity class returns.
        Parameters:
        entityType - The entity type which should be queried
        Returns:
        The query builder for chaining calls
        Since:
        1.3.0
      • from

        X from​(javax.persistence.metamodel.EntityType<?> entityType,
               String alias)
        Sets the entity class on which the query should be based on with the given alias.
        Parameters:
        entityType - The entity type which should be queried
        alias - The alias for the entity
        Returns:
        The query builder for chaining calls
        Since:
        1.3.0
      • fromOld

        X fromOld​(Class<?> entityClass)
        Like from(Class) but explicitly queries the data before any side effects happen because of CTEs.
        Parameters:
        entityClass - The entity class which should be queried
        Returns:
        The query builder for chaining calls
        Since:
        1.1.0
      • fromOld

        X fromOld​(Class<?> entityClass,
                  String alias)
        Like from(Class, String) but explicitly queries the data before any side effects happen because of CTEs.
        Parameters:
        entityClass - The entity class which should be queried
        alias - The alias for the entity
        Returns:
        The query builder for chaining calls
        Since:
        1.1.0
      • fromNew

        X fromNew​(Class<?> entityClass)
        Like from(Class) but explicitly queries the data after any side effects happen because of CTEs.
        Parameters:
        entityClass - The entity class which should be queried
        Returns:
        The query builder for chaining calls
        Since:
        1.1.0
      • fromNew

        X fromNew​(Class<?> entityClass,
                  String alias)
        Like from(Class, String) but explicitly queries the data after any side effects happen because of CTEs.
        Parameters:
        entityClass - The entity class which should be queried
        alias - The alias for the entity
        Returns:
        The query builder for chaining calls
        Since:
        1.1.0
      • fromValues

        X fromValues​(Class<?> valueClass,
                     String alias,
                     int valueCount)
        Add a VALUES clause for values of the given value class to the from clause. This introduces a parameter named like the given alias. To set the values invoke ParameterHolder.setParameter(String, Object) or Query.setParameter(String, Object) with the alias and a collection.
        Parameters:
        valueClass - The class of the basic or managed type for which to create a VALUES clause
        alias - The alias for the entity
        valueCount - The number of values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.2.0
      • fromValues

        X fromValues​(Class<?> entityBaseClass,
                     String attributeName,
                     String alias,
                     int valueCount)
        Add a VALUES clause for values of the type as determined by the given entity attribute to the from clause. This introduces a parameter named like the given alias. To set the values invoke ParameterHolder.setParameter(String, Object) or Query.setParameter(String, Object) with the alias and a collection.
        Parameters:
        entityBaseClass - The entity class on which the attribute is located
        attributeName - The attribute name within the entity class which to use for determining the values type
        alias - The alias for the entity
        valueCount - The number of values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.3.0
      • fromIdentifiableValues

        X fromIdentifiableValues​(Class<?> valueClass,
                                 String alias,
                                 int valueCount)
        Add a VALUES clause for values of the given value class to the from clause. This introduces a parameter named like the given alias. In contrast to fromValues(Class, String, int) this will only bind the id attribute. To set the values invoke ParameterHolder.setParameter(String, Object) or Query.setParameter(String, Object) with the alias and a collection.
        Parameters:
        valueClass - The class of the identifiable type for which to create a VALUES clause
        alias - The alias for the entity
        valueCount - The number of values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.2.0
      • fromIdentifiableValues

        X fromIdentifiableValues​(Class<?> valueClass,
                                 String identifierAttribute,
                                 String alias,
                                 int valueCount)
        Add a VALUES clause for values of the given value class to the from clause. This introduces a parameter named like the given alias. In contrast to fromValues(Class, String, int) this will only bind the identifier attribute. To set the values invoke ParameterHolder.setParameter(String, Object) or Query.setParameter(String, Object) with the alias and a collection.
        Parameters:
        valueClass - The class of the identifiable type for which to create a VALUES clause
        identifierAttribute - The attribute of the entity type to consider as identifier attribute
        alias - The alias for the entity
        valueCount - The number of values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.4.0
      • fromValues

        <T> X fromValues​(Class<T> valueClass,
                         String alias,
                         Collection<T> values)
        Like fromValues(Class, String, int) but passes the collection size as valueCount and directly binds the collection as parameter via ParameterHolder.setParameter(String, Object).
        Type Parameters:
        T - The type of the values
        Parameters:
        valueClass - The class of the basic or managed type for which to create a VALUES clause
        alias - The alias for the entity
        values - The values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.2.0
      • fromValues

        X fromValues​(Class<?> entityBaseClass,
                     String attributeName,
                     String alias,
                     Collection<?> values)
        Like fromValues(Class, String, String, int) but passes the collection size as valueCount and directly binds the collection as parameter via ParameterHolder.setParameter(String, Object).
        Parameters:
        entityBaseClass - The entity class on which the attribute is located
        attributeName - The attribute name within the entity class which to use for determining the values type
        alias - The alias for the entity
        values - The values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.3.0
      • fromIdentifiableValues

        <T> X fromIdentifiableValues​(Class<T> valueClass,
                                     String alias,
                                     Collection<T> values)
        Like fromIdentifiableValues(Class, String, int) but passes the collection size as valueCount and directly binds the collection as parameter via ParameterHolder.setParameter(String, Object).
        Type Parameters:
        T - The type of the values
        Parameters:
        valueClass - The class of the identifiable type for which to create a VALUES clause
        alias - The alias for the entity
        values - The values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.2.0
      • fromIdentifiableValues

        <T> X fromIdentifiableValues​(Class<T> valueClass,
                                     String identifierAttribute,
                                     String alias,
                                     Collection<T> values)
        Like fromIdentifiableValues(Class, String, String, int) but passes the collection size as valueCount and directly binds the collection as parameter via ParameterHolder.setParameter(String, Object).
        Type Parameters:
        T - The type of the values
        Parameters:
        valueClass - The class of the identifiable type for which to create a VALUES clause
        identifierAttribute - The attribute of the entity type to consider as identifier attribute
        alias - The alias for the entity
        values - The values to use for the values clause
        Returns:
        The query builder for chaining calls
        Since:
        1.4.0
      • fromSubquery

        FullSelectCTECriteriaBuilder<X> fromSubquery​(Class<?> cteClass,
                                                     String alias)
        Like calling from(Class, String) followed by CTEBuilder.with(Class, boolean) with inline = true. Registers the given CTE entity type as FROM clause node under the given alias and returns a CTE builder that will be inlined.
        Parameters:
        cteClass - The CTE entity type for the subquery in the FROM clause
        alias - The alias for the FROM clause item
        Returns:
        The CTE builder for the subquery in the FROM clause
        Since:
        1.4.1
      • fromEntitySubquery

        FullSelectCTECriteriaBuilder<X> fromEntitySubquery​(Class<?> entityClass,
                                                           String alias)
        Like calling from(Class, String) followed by CTEBuilder.with(Class, boolean) with inline = true. Registers the given entity type as FROM clause node under the given alias and returns a CTE builder that will be inlined with all attributes bound.
        Parameters:
        entityClass - The entity type for the subquery in the FROM clause
        alias - The alias for the FROM clause item
        Returns:
        The CTE builder for the subquery in the FROM clause
        Since:
        1.4.1
      • fromEntitySubquery

        FullSelectCTECriteriaBuilder<X> fromEntitySubquery​(Class<?> entityClass,
                                                           String alias,
                                                           String subqueryAlias)
        Like calling from(Class, String) followed by CTEBuilder.with(Class, boolean) with inline = true. Registers the given entity type as FROM clause node under the given alias and returns a CTE builder that will be inlined with all attributes bound.
        Parameters:
        entityClass - The entity type for the subquery in the FROM clause
        alias - The alias for the FROM clause item
        subqueryAlias - The alias for the FROM clause item in the subquery
        Returns:
        The CTE builder for the subquery in the FROM clause
        Since:
        1.4.1