Interface CriteriaBuilderFactory

    • Method Detail

      • getRegisteredFunctions

        Map<String,​JpqlFunction> getRegisteredFunctions()
        Returns all functions that are available in queries as a map of function name to JpqlFunction.
        Returns:
        The registered functions
        Since:
        1.2.0
      • startSet

        <T> StartOngoingSetOperationCriteriaBuilder<T,​LeafOngoingFinalSetOperationCriteriaBuilder<T>> startSet​(javax.persistence.EntityManager entityManager,
                                                                                                                     Class<T> resultClass)
        Starts a criteria builder with a nested set operation builder. Doing this is like starting a nested query that will be connected via a set operation.
        Type Parameters:
        T - The type of the result class
        Parameters:
        entityManager - The entity manager to use for the criteria builder
        resultClass - The result class of the query
        Returns:
        The set operation builder
        Since:
        1.2.0
      • create

        <T> CriteriaBuilder<T> create​(javax.persistence.EntityManager entityManager,
                                      Class<T> resultClass,
                                      String alias)
        Creates a new criteria builder with the given result class. The result class will be used as default from class. The alias will be used as default alias for the from class. Both can be overridden by invoking FromBuilder.from(java.lang.Class, java.lang.String).
        Type Parameters:
        T - The type of the result class
        Parameters:
        entityManager - The entity manager to use for the criteria builder
        resultClass - The result class of the query
        alias - The alias that should be used for the result class from clause
        Returns:
        A new criteria builder
      • delete

        <T> DeleteCriteriaBuilder<T> delete​(javax.persistence.EntityManager entityManager,
                                            Class<T> deleteClass,
                                            String alias)
        Creates a new delete criteria builder for the given entity class.
        Type Parameters:
        T - The type of the entity for the delete criteria
        Parameters:
        entityManager - The entity manager to use for the delete criteria builder
        deleteClass - The entity class for the delete criteria
        alias - The alias that should be used for the entity
        Returns:
        A new delete criteria builder
        Since:
        1.1.0
      • deleteCollection

        <T> DeleteCriteriaBuilder<T> deleteCollection​(javax.persistence.EntityManager entityManager,
                                                      Class<T> deleteOwnerClass,
                                                      String alias,
                                                      String collectionName)
        Creates a new delete criteria builder for the given entity class and collection name to delete elements of the entity class's collection.
        Type Parameters:
        T - The type of the entity for the delete criteria
        Parameters:
        entityManager - The entity manager to use for the delete criteria builder
        deleteOwnerClass - The entity class owning the collection for the delete criteria
        alias - The alias that should be used for the entity
        collectionName - The name of the collection contained in the owner entity class
        Returns:
        A new delete criteria builder
        Since:
        1.2.0
      • update

        <T> UpdateCriteriaBuilder<T> update​(javax.persistence.EntityManager entityManager,
                                            Class<T> updateClass,
                                            String alias)
        Creates a new update criteria builder for the given entity class.
        Type Parameters:
        T - The type of the entity for the update criteria
        Parameters:
        entityManager - The entity manager to use for the update criteria builder
        updateClass - The entity class for the update criteria
        alias - The alias that should be used for the entity
        Returns:
        A new update criteria builder
        Since:
        1.1.0
      • updateCollection

        <T> UpdateCriteriaBuilder<T> updateCollection​(javax.persistence.EntityManager entityManager,
                                                      Class<T> updateOwnerClass,
                                                      String alias,
                                                      String collectionName)
        Creates a new update criteria builder for the given entity class and collection name to update elements of the entity class's collection.
        Type Parameters:
        T - The type of the entity for the update criteria
        Parameters:
        entityManager - The entity manager to use for the update criteria builder
        updateOwnerClass - The entity class owning the collection for the update criteria
        alias - The alias that should be used for the entity
        collectionName - The name of the collection contained in the owner entity class
        Returns:
        A new update criteria builder
        Since:
        1.2.0
      • insert

        <T> InsertCriteriaBuilder<T> insert​(javax.persistence.EntityManager entityManager,
                                            Class<T> insertClass)
        Creates a new insert criteria builder for the given entity class.
        Type Parameters:
        T - The type of the entity for the insert criteria
        Parameters:
        entityManager - The entity manager to use for the insert criteria builder
        insertClass - The entity class for the insert criteria
        Returns:
        A new insert criteria builder
        Since:
        1.1.0
      • insertCollection

        <T> InsertCriteriaBuilder<T> insertCollection​(javax.persistence.EntityManager entityManager,
                                                      Class<T> insertOwnerClass,
                                                      String collectionName)
        Creates a new insert criteria builder for the given entity class and collection name to update elements of the entity class's collection.
        Type Parameters:
        T - The type of the entity for the insert criteria
        Parameters:
        entityManager - The entity manager to use for the insert criteria builder
        insertOwnerClass - The entity class owning the collection for the insert criteria
        collectionName - The name of the collection contained in the owner entity class
        Returns:
        A new insert criteria builder
        Since:
        1.2.0