Package com.blazebit.persistence.spi
Interface CriteriaBuilderConfiguration
-
public interface CriteriaBuilderConfigurationA configuration for aCriteriaBuilderFactorywhich is mostly used in non Java EE environments.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CriteriaBuilderConfigurationaddProperties(Properties extraProperties)Add the given properties to the properties of the configuration.CriteriaBuilderFactorycreateCriteriaBuilderFactory(javax.persistence.EntityManagerFactory entityManagerFactory)Creates a new CriteriaBuilderFactory based on this configuration.List<EntityManagerFactoryIntegrator>getEntityManagerIntegrators()Returns a list of registered entity manager enrichers.JpqlFunctionGroupgetFunction(String name)Returns theJpqlFunctionGroupfor registered function with the given name ornull.Set<String>getFunctionNames()Returns the set of registered functions.Set<String>getMacroNames()Returns the set of registered macros.Map<String,Class<?>>getNamedTypes()Returns a map of registered named types.PropertiesgetProperties()Returns all properties.StringgetProperty(String propertyName)Returns a property value by name.CriteriaBuilderConfigurationmergeProperties(Properties properties)Adds the given properties to the properties of the configuration, without overriding existing values.CriteriaBuilderConfigurationregisterDialect(String dbms, DbmsDialect dialect)Registers the given dialect for the given dbms name.CriteriaBuilderConfigurationregisterEntityManagerIntegrator(EntityManagerFactoryIntegrator entityManagerEnricher)Registers the given entity manager enricher in the configuration.CriteriaBuilderConfigurationregisterFunction(JpqlFunctionGroup jpqlFunctionGroup)Registers the given jpql function group in the configuration.CriteriaBuilderConfigurationregisterMacro(String macroName, JpqlMacro jpqlMacro)Registers the given jpql macro in the configuration.CriteriaBuilderConfigurationregisterNamedType(String name, Class<?> type)Registers the given type under the given name.CriteriaBuilderConfigurationsetProperties(Properties properties)Replace the properties of the configuration with the given properties.CriteriaBuilderConfigurationsetProperty(String propertyName, String value)Set a property value by name.CriteriaBuilderConfigurationwithPackageOpener(PackageOpener packageOpener)Sets the package opener to use for obtaining access to user classes.
-
-
-
Method Detail
-
withPackageOpener
CriteriaBuilderConfiguration withPackageOpener(PackageOpener packageOpener)
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
CriteriaBuilderConfiguration registerNamedType(String name, Class<?> type)
Registers the given type under the given name. This makes the type usable for theVALUESclause.- Parameters:
name- The name of the typetype- The type- Returns:
- this for method chaining
- Since:
- 1.2.0
-
registerFunction
CriteriaBuilderConfiguration registerFunction(JpqlFunctionGroup jpqlFunctionGroup)
Registers the given jpql function group in the configuration.- Parameters:
jpqlFunctionGroup- The jpql function group- Returns:
- this for method chaining
-
registerMacro
CriteriaBuilderConfiguration registerMacro(String macroName, JpqlMacro jpqlMacro)
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
CriteriaBuilderConfiguration registerDialect(String dbms, DbmsDialect dialect)
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
JpqlFunctionGroup getFunction(String name)
Returns theJpqlFunctionGroupfor 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
Set<String> getFunctionNames()
Returns the set of registered functions.- Returns:
- the set of registered functions
-
getMacroNames
Set<String> getMacroNames()
Returns the set of registered macros.- Returns:
- the set of registered macros
-
getNamedTypes
Map<String,Class<?>> 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
String getProperty(String propertyName)
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
CriteriaBuilderConfiguration setProperties(Properties properties)
Replace the properties of the configuration with the given properties.- Parameters:
properties- The new set of properties- Returns:
- this for method chaining
-
addProperties
CriteriaBuilderConfiguration addProperties(Properties extraProperties)
Add the given properties to the properties of the configuration.- Parameters:
extraProperties- The properties to add.- Returns:
- this for method chaining
-
mergeProperties
CriteriaBuilderConfiguration mergeProperties(Properties properties)
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
CriteriaBuilderConfiguration setProperty(String propertyName, String value)
Set a property value by name.- Parameters:
propertyName- The name of the property to setvalue- The new property value- Returns:
- this for method chaining
-
-