Package com.blazebit.persistence.spi
Interface CriteriaBuilderConfiguration
public interface CriteriaBuilderConfiguration
A configuration for a
CriteriaBuilderFactory
which is mostly used in non Java EE environments.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionaddProperties
(Properties extraProperties) Add the given properties to the properties of the configuration.createCriteriaBuilderFactory
(javax.persistence.EntityManagerFactory entityManagerFactory) Creates a new CriteriaBuilderFactory based on this configuration.Returns a list of registered entity manager enrichers.getFunction
(String name) Returns theJpqlFunctionGroup
for registered function with the given name ornull
.Returns the set of registered functions.Returns the set of registered macros.Returns a map of registered named types.Returns all properties.getProperty
(String propertyName) Returns a property value by name.mergeProperties
(Properties properties) Adds the given properties to the properties of the configuration, without overriding existing values.registerDialect
(String dbms, DbmsDialect dialect) Registers the given dialect for the given dbms name.registerEntityManagerIntegrator
(EntityManagerFactoryIntegrator entityManagerEnricher) Registers the given entity manager enricher in the configuration.registerFunction
(JpqlFunctionGroup jpqlFunctionGroup) Registers the given jpql function group in the configuration.registerMacro
(String macroName, JpqlMacro jpqlMacro) Registers the given jpql macro in the configuration.registerNamedType
(String name, Class<?> type) Registers the given type under the given name.setProperties
(Properties properties) Replace the properties of the configuration with the given properties.setProperty
(String propertyName, String value) Set a property value by name.withPackageOpener
(PackageOpener packageOpener) Sets the package opener to use for obtaining access to user classes.
-
Method Details
-
withPackageOpener
Sets the package opener to use for obtaining access to user classes.- Parameters:
packageOpener
- The package opener to use to obtain access to user classes- Returns:
- this for method chaining
- Since:
- 1.2.0
-
registerNamedType
Registers the given type under the given name. This makes the type usable for theVALUES
clause.- Parameters:
name
- The name of the typetype
- The type- Returns:
- this for method chaining
- Since:
- 1.2.0
-
registerFunction
Registers the given jpql function group in the configuration.- Parameters:
jpqlFunctionGroup
- The jpql function group- Returns:
- this for method chaining
-
registerMacro
Registers the given jpql macro in the configuration.- Parameters:
macroName
- The name of the macrojpqlMacro
- The jpql macro- Returns:
- this for method chaining
- Since:
- 1.2.0
-
registerDialect
Registers the given dialect for the given dbms name.- Parameters:
dbms
- The dbms for which the dialect should be registereddialect
- The dialect which should be registered- Returns:
- this for method chaining
- Since:
- 1.1.0
-
getFunction
Returns theJpqlFunctionGroup
for registered function with the given name ornull
.- Parameters:
name
- The name of the functino to retrieve- Returns:
- the registered function or
null
- Since:
- 1.2.0
-
getFunctionNames
Returns the set of registered functions.- Returns:
- the set of registered functions
-
getMacroNames
Returns the set of registered macros.- Returns:
- the set of registered macros
-
getNamedTypes
Returns a map of registered named types.- Returns:
- a map of the registered named types
- Since:
- 1.2.0
-
registerEntityManagerIntegrator
CriteriaBuilderConfiguration registerEntityManagerIntegrator(EntityManagerFactoryIntegrator entityManagerEnricher) Registers the given entity manager enricher in the configuration.- Parameters:
entityManagerEnricher
- The enricher that should be added- Returns:
- this for method chaining
-
getEntityManagerIntegrators
List<EntityManagerFactoryIntegrator> getEntityManagerIntegrators()Returns a list of registered entity manager enrichers.- Returns:
- A list of registered entity manager enrichers
-
createCriteriaBuilderFactory
CriteriaBuilderFactory createCriteriaBuilderFactory(javax.persistence.EntityManagerFactory entityManagerFactory) Creates a new CriteriaBuilderFactory based on this configuration.- Parameters:
entityManagerFactory
- The entity manager factory for which the criteria builder factory should be created- Returns:
- A new CriteriaBuilderFactory
-
getProperties
Properties getProperties()Returns all properties.- Returns:
- All properties
-
getProperty
Returns a property value by name.- Parameters:
propertyName
- The name of the property- Returns:
- The value currently associated with that property name; may be null.
-
setProperties
Replace the properties of the configuration with the given properties.- Parameters:
properties
- The new set of properties- Returns:
- this for method chaining
-
addProperties
Add the given properties to the properties of the configuration.- Parameters:
extraProperties
- The properties to add.- Returns:
- this for method chaining
-
mergeProperties
Adds the given properties to the properties of the configuration, without overriding existing values.- Parameters:
properties
- The properties to merge- Returns:
- this for method chaining
-
setProperty
Set a property value by name.- Parameters:
propertyName
- The name of the property to setvalue
- The new property value- Returns:
- this for method chaining
-