Package com.blazebit.persistence
Interface CriteriaBuilderFactory
- All Superinterfaces:
ConfigurationSource
,ServiceProvider
public interface CriteriaBuilderFactory extends ServiceProvider, ConfigurationSource
An interface used to create criteria builders.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and Type Method Description <T> CriteriaBuilder<T>
create(javax.persistence.EntityManager entityManager, Class<T> resultClass)
Likecreate(javax.persistence.EntityManager, java.lang.Class, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the result class returns.<T> CriteriaBuilder<T>
create(javax.persistence.EntityManager entityManager, Class<T> resultClass, String alias)
Creates a new criteria builder with the given result class.<T> DeleteCriteriaBuilder<T>
delete(javax.persistence.EntityManager entityManager, Class<T> deleteClass)
Likedelete(javax.persistence.EntityManager, java.lang.Class, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the delete class returns.<T> DeleteCriteriaBuilder<T>
delete(javax.persistence.EntityManager entityManager, Class<T> deleteClass, String alias)
Creates a new delete criteria builder for the given entity class.<T> DeleteCriteriaBuilder<T>
deleteCollection(javax.persistence.EntityManager entityManager, Class<T> deleteOwnerClass, String collectionName)
LikedeleteCollection(javax.persistence.EntityManager, java.lang.Class, java.lang.String, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the delete owner class returns.<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.Map<String,JpqlFunction>
getRegisteredFunctions()
Returns all functions that are available in queries as a map of function name toJpqlFunction
.<T> InsertCriteriaBuilder<T>
insert(javax.persistence.EntityManager entityManager, Class<T> insertClass)
Creates a new insert criteria builder for the given entity class.<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.<T> StartOngoingSetOperationCriteriaBuilder<T,LeafOngoingFinalSetOperationCriteriaBuilder<T>>
startSet(javax.persistence.EntityManager entityManager, Class<T> resultClass)
Starts a criteria builder with a nested set operation builder.<T> UpdateCriteriaBuilder<T>
update(javax.persistence.EntityManager entityManager, Class<T> updateClass)
Likeupdate(javax.persistence.EntityManager, java.lang.Class, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the update class returns.<T> UpdateCriteriaBuilder<T>
update(javax.persistence.EntityManager entityManager, Class<T> updateClass, String alias)
Creates a new update criteria builder for the given entity class.<T> UpdateCriteriaBuilder<T>
updateCollection(javax.persistence.EntityManager entityManager, Class<T> updateOwnerClass, String collectionName)
LikeupdateCollection(javax.persistence.EntityManager, java.lang.Class, java.lang.String, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the delete owner class returns.<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.Methods inherited from interface com.blazebit.persistence.spi.ConfigurationSource
getProperties, getProperty
-
Method Details
-
getRegisteredFunctions
Map<String,JpqlFunction> getRegisteredFunctions()Returns all functions that are available in queries as a map of function name toJpqlFunction
.- 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 builderresultClass
- The result class of the query- Returns:
- The set operation builder
- Since:
- 1.2.0
-
create
Likecreate(javax.persistence.EntityManager, java.lang.Class, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the result class returns.- Type Parameters:
T
- The type of the result class- Parameters:
entityManager
- The entity manager to use for the criteria builderresultClass
- The result class of the query- Returns:
- A new criteria builder
-
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 invokingFromBuilder.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 builderresultClass
- The result class of the queryalias
- 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)Likedelete(javax.persistence.EntityManager, java.lang.Class, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the delete class returns.- Type Parameters:
T
- The type of the entity for the delete criteria- Parameters:
entityManager
- The entity manager to use for the delete criteria builderdeleteClass
- The entity class for the delete criteria- Returns:
- A new delete criteria builder
- Since:
- 1.1.0
-
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 builderdeleteClass
- The entity class for the delete criteriaalias
- 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 collectionName)LikedeleteCollection(javax.persistence.EntityManager, java.lang.Class, java.lang.String, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the delete owner class returns.- Type Parameters:
T
- The type of the entity for the delete criteria- Parameters:
entityManager
- The entity manager to use for the delete criteria builderdeleteOwnerClass
- The entity class owning the collection for the delete criteriacollectionName
- The name of the collection contained in the owner entity class- Returns:
- A new delete criteria builder
- Since:
- 1.2.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 builderdeleteOwnerClass
- The entity class owning the collection for the delete criteriaalias
- The alias that should be used for the entitycollectionName
- 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)Likeupdate(javax.persistence.EntityManager, java.lang.Class, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the update class returns.- Type Parameters:
T
- The type of the entity for the update criteria- Parameters:
entityManager
- The entity manager to use for the update criteria builderupdateClass
- The entity class for the update criteria- Returns:
- A new update criteria builder
- Since:
- 1.1.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 builderupdateClass
- The entity class for the update criteriaalias
- 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 collectionName)LikeupdateCollection(javax.persistence.EntityManager, java.lang.Class, java.lang.String, java.lang.String)
but with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the delete owner class returns.- Type Parameters:
T
- The type of the entity for the update criteria- Parameters:
entityManager
- The entity manager to use for the update criteria builderupdateOwnerClass
- The entity class owning the collection for the update criteriacollectionName
- The name of the collection contained in the owner entity class- Returns:
- A new update criteria builder
- Since:
- 1.2.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 builderupdateOwnerClass
- The entity class owning the collection for the update criteriaalias
- The alias that should be used for the entitycollectionName
- 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 builderinsertClass
- 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 builderinsertOwnerClass
- The entity class owning the collection for the insert criteriacollectionName
- The name of the collection contained in the owner entity class- Returns:
- A new insert criteria builder
- Since:
- 1.2.0
-