Interface EntityViewConfiguration
public interface EntityViewConfiguration
This class is used to configure the entity view manager that it creates.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionaddEntityView
(Class<?> clazz) Adds the given class to the set of known entity views.addEntityViewListener
(Class<?> entityViewListenerClass) Registers the given entity view listener class.addEntityViewListener
(Class<?> entityViewClass, Class<?> entityViewListenerClass) Registers the given entity view listener class for the given entity view class.addEntityViewListener
(Class<?> entityViewClass, Class<?> entityClass, Class<?> entityViewListenerClass) Registers the given entity view listener class for the given entity view and entity class.addOptionalParameters
(Map<String, Object> optionalParameters) Add the given optional parameters to the optional parameters of the configuration.addProperties
(Properties extraProperties) Add the given properties to the properties of the configuration.createEntityViewManager
(CriteriaBuilderFactory criteriaBuilderFactory) Creates a new entity view manager from this configuration.createEntityViewManager
(CriteriaBuilderFactory criteriaBuilderFactory, javax.persistence.EntityManagerFactory entityManagerFactory) Deprecated.Will be removed.createEntityViewMapping
(Class<?> clazz) Creates an entity view mapping based on the given annotated class that can be further refined and finally added.Map<Class<?>,
BasicUserType<?>> Returns the currently registered basic user types.Returns the global entity view listener classes.getEntityViewListeners
(Class<?> entityViewClass) Returns the entity view listener classes registered for the given entity view class.getEntityViewListeners
(Class<?> entityViewClass, Class<?> entityClass) Returns the entity view listener classes registered for the given entity view and entity class.Returns the currently registered entity view mappings.Returns the currently known entity views.getOptionalParameter
(String name) Returns the optional parameter value by name.Returns all globally configured optional parameters.Returns all properties.getProperty
(String propertyName) Returns a property value by name.Returns the configured transaction support.Map<Class<?>,
Map<Class<?>, TypeConverter<?, ?>>> Returns the currently registered type converters.<Y> Map<Class<?>,
TypeConverter<?, Y>> getTypeConverters
(Class<Y> viewModelType) Returns the currently registered type converters for the given view model type.Returns all type test values that should be used for checking the equals/hashCode implementation of JPA types.mergeProperties
(Properties properties) Adds the given properties to the properties of the configuration, without overriding existing values.registerBasicUserType
(Class<X> clazz, BasicUserType<X> userType) Registers the given user type for the given class.<X,
Y> EntityViewConfiguration registerTypeConverter
(Class<X> underlyingType, Class<Y> viewModelType, TypeConverter<X, Y> converter) Registers the given converter for the given types.setOptionalParameter
(String name, Object value) Set the optional parameter with the given name to the given value.setOptionalParameters
(Map<String, Object> optionalParameters) Replace the optional parameters of the configuration with the given optional parameters.setProperties
(Properties properties) Replace the properties of the configuration with the given properties.setProperty
(String propertyName, String value) Set a property value by name.setTransactionSupport
(TransactionSupport transactionSupport) Sets the given transaction support.setTypeTestValue
(Class<T> type, T value) Sets the given value as type test value for the given type.
-
Method Details
-
addEntityView
Adds the given class to the set of known entity views.- Parameters:
clazz
- The class to be added- Returns:
- this for method chaining
-
createEntityViewMapping
Creates an entity view mapping based on the given annotated class that can be further refined and finally added.- Parameters:
clazz
- The annotated class to base the mapping on- Returns:
- the entity view mapping
- Since:
- 1.2.0
-
addEntityViewListener
Registers the given entity view listener class.- Parameters:
entityViewListenerClass
- The entity view listener class to register- Returns:
- this for method chaining
- Since:
- 1.4.0
-
addEntityViewListener
EntityViewConfiguration addEntityViewListener(Class<?> entityViewClass, Class<?> entityViewListenerClass) Registers the given entity view listener class for the given entity view class.- Parameters:
entityViewClass
- The entity view class for which to register the given entity view listener classentityViewListenerClass
- The entity view listener class to register- Returns:
- this for method chaining
- Since:
- 1.4.0
-
addEntityViewListener
EntityViewConfiguration addEntityViewListener(Class<?> entityViewClass, Class<?> entityClass, Class<?> entityViewListenerClass) Registers the given entity view listener class for the given entity view and entity class.- Parameters:
entityViewClass
- The entity view class for which to register the given entity view listener classentityClass
- The entity class for which to register the given entity view listener classentityViewListenerClass
- The entity view listener class to register- Returns:
- this for method chaining
- Since:
- 1.4.0
-
registerBasicUserType
Registers the given user type for the given class.- Type Parameters:
X
- The type of the class- Parameters:
clazz
- The class for which to register the user typeuserType
- The user type implementation- Returns:
- this for method chaining
- Since:
- 1.2.0
-
registerTypeConverter
<X,Y> EntityViewConfiguration registerTypeConverter(Class<X> underlyingType, Class<Y> viewModelType, TypeConverter<X, Y> converter) Registers the given converter for the given types.- Type Parameters:
X
- The underlying typeY
- The entity view model type- Parameters:
underlyingType
- The underlying type supported by the entity view type systemviewModelType
- The entity view model typeconverter
- The type converter- Returns:
- this for method chaining
- Since:
- 1.2.0
-
createEntityViewManager
Creates a new entity view manager from this configuration.- Parameters:
criteriaBuilderFactory
- The criteria builder factory for which the entity view manager should be created- Returns:
- A new entity view manager
- Since:
- 1.2.0
-
createEntityViewManager
@Deprecated EntityViewManager createEntityViewManager(CriteriaBuilderFactory criteriaBuilderFactory, javax.persistence.EntityManagerFactory entityManagerFactory) Deprecated.Will be removed. UsecreateEntityViewManager(CriteriaBuilderFactory)
instead.Creates a new entity view manager from this configuration.- Parameters:
criteriaBuilderFactory
- The criteria builder factory for which the entity view manager should be createdentityManagerFactory
- The entity manager factory for which the entity view manager should be created- Returns:
- A new entity view manager
-
getEntityViews
Returns the currently known entity views.- Returns:
- The currently known entity views
-
getEntityViewMappings
Collection<EntityViewMapping> getEntityViewMappings()Returns the currently registered entity view mappings.- Returns:
- The currently registered entity view mappings.
- Since:
- 1.2.0
-
getEntityViewListeners
Returns the global entity view listener classes.- Returns:
- the global entity view listeners
- Since:
- 1.4.0
-
getEntityViewListeners
Returns the entity view listener classes registered for the given entity view class.- Parameters:
entityViewClass
- The entity view class for which to retrieve the registered entity view listener classes- Returns:
- the entity view listeners registered for the given entity view class
- Since:
- 1.4.0
-
getEntityViewListeners
Returns the entity view listener classes registered for the given entity view and entity class.- Parameters:
entityViewClass
- The entity view class for which to retrieve the registered entity view listener classesentityClass
- The entity class for which to retrieve the registered entity view listener classes- Returns:
- the entity view listeners registered for the given entity view class and entity class
- Since:
- 1.4.0
-
getBasicUserTypes
Map<Class<?>,BasicUserType<?>> getBasicUserTypes()Returns the currently registered basic user types.- Returns:
- The currently registered basic user types.
- Since:
- 1.2.0
-
getTypeConverters
Map<Class<?>,Map<Class<?>, getTypeConverters()TypeConverter<?, ?>>> Returns the currently registered type converters.- Returns:
- The currently registered type converters.
- Since:
- 1.2.0
-
getTypeConverters
Returns the currently registered type converters for the given view model type.- Type Parameters:
Y
- The entity view model type- Parameters:
viewModelType
- The view model type- Returns:
- The currently registered type converters for the given view model type.
- Since:
- 1.2.0
-
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
-
getTypeTestValues
Returns all type test values that should be used for checking the equals/hashCode implementation of JPA types.- Returns:
- All type test values
- Since:
- 1.3.0
-
setTypeTestValue
Sets the given value as type test value for the given type.- Type Parameters:
T
- The type- Parameters:
type
- The type for which to register the valuevalue
- The value which is used for testing- Returns:
- this for method chaining
- Since:
- 1.3.0
-
getTransactionSupport
TransactionSupport getTransactionSupport()Returns the configured transaction support.- Returns:
- the configured transaction support
-
setTransactionSupport
Sets the given transaction support.- Parameters:
transactionSupport
- The transaction support- Returns:
- this for method chaining
- Since:
- 1.4.0
-
getOptionalParameters
Returns all globally configured optional parameters.- Returns:
- All globally configured optional parameters
- Since:
- 1.5.0
-
getOptionalParameter
Returns the optional parameter value by name.- Parameters:
name
- The name of the parameter- Returns:
- The value currently associated with that optional parameter name; may be null.
- Since:
- 1.5.0
-
setOptionalParameter
Set the optional parameter with the given name to the given value.- Parameters:
name
- The name of the parametervalue
- The value of the parameter- Returns:
- this for method chaining
- Since:
- 1.5.0
-
setOptionalParameters
Replace the optional parameters of the configuration with the given optional parameters.- Parameters:
optionalParameters
- The new optional parameters- Returns:
- this for method chaining
- Since:
- 1.5.0
-
addOptionalParameters
Add the given optional parameters to the optional parameters of the configuration.- Parameters:
optionalParameters
- The optional parameters to add.- Returns:
- this for method chaining
- Since:
- 1.5.0
-