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 Details

    • addEntityView

      EntityViewConfiguration addEntityView​(Class<?> clazz)
      Adds the given class to the set of known entity views.
      Parameters:
      clazz - The class to be added
      Returns:
      this for method chaining
    • createEntityViewMapping

      EntityViewMapping createEntityViewMapping​(Class<?> clazz)
      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

      EntityViewConfiguration addEntityViewListener​(Class<?> entityViewListenerClass)
      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 class
      entityViewListenerClass - 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 class
      entityClass - The entity class for which to register the given entity view listener class
      entityViewListenerClass - The entity view listener class to register
      Returns:
      this for method chaining
      Since:
      1.4.0
    • registerBasicUserType

      <X> EntityViewConfiguration registerBasicUserType​(Class<X> clazz, BasicUserType<X> userType)
      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 type
      userType - 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 type
      Y - The entity view model type
      Parameters:
      underlyingType - The underlying type supported by the entity view type system
      viewModelType - The entity view model type
      converter - The type converter
      Returns:
      this for method chaining
      Since:
      1.2.0
    • createEntityViewManager

      EntityViewManager createEntityViewManager​(CriteriaBuilderFactory criteriaBuilderFactory)
      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.
      Creates a new entity view manager from this configuration.
      Parameters:
      criteriaBuilderFactory - The criteria builder factory for which the entity view manager should be created
      entityManagerFactory - The entity manager factory for which the entity view manager should be created
      Returns:
      A new entity view manager
    • getEntityViews

      Set<Class<?>> 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

      Set<Class<?>> getEntityViewListeners()
      Returns the global entity view listener classes.
      Returns:
      the global entity view listeners
      Since:
      1.4.0
    • getEntityViewListeners

      Set<Class<?>> getEntityViewListeners​(Class<?> entityViewClass)
      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

      Set<Class<?>> getEntityViewListeners​(Class<?> entityViewClass, Class<?> entityClass)
      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 classes
      entityClass - 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<?>,​TypeConverter<?,​?>>> getTypeConverters()
      Returns the currently registered type converters.
      Returns:
      The currently registered type converters.
      Since:
      1.2.0
    • getTypeConverters

      <Y> Map<Class<?>,​TypeConverter<?,​Y>> getTypeConverters​(Class<Y> viewModelType)
      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

      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

      EntityViewConfiguration 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

      EntityViewConfiguration 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

      EntityViewConfiguration 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

      EntityViewConfiguration setProperty​(String propertyName, String value)
      Set a property value by name.
      Parameters:
      propertyName - The name of the property to set
      value - The new property value
      Returns:
      this for method chaining
    • getTypeTestValues

      Map<Class<?>,​Object> 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

      <T> EntityViewConfiguration setTypeTestValue​(Class<T> type, T value)
      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 value
      value - 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

      EntityViewConfiguration setTransactionSupport​(TransactionSupport transactionSupport)
      Sets the given transaction support.
      Parameters:
      transactionSupport - The transaction support
      Returns:
      this for method chaining
      Since:
      1.4.0
    • getOptionalParameters

      Map<String,​Object> getOptionalParameters()
      Returns all globally configured optional parameters.
      Returns:
      All globally configured optional parameters
      Since:
      1.5.0
    • getOptionalParameter

      Object getOptionalParameter​(String name)
      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

      EntityViewConfiguration setOptionalParameter​(String name, Object value)
      Set the optional parameter with the given name to the given value.
      Parameters:
      name - The name of the parameter
      value - The value of the parameter
      Returns:
      this for method chaining
      Since:
      1.5.0
    • setOptionalParameters

      EntityViewConfiguration setOptionalParameters​(Map<String,​Object> optionalParameters)
      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

      EntityViewConfiguration addOptionalParameters​(Map<String,​Object> optionalParameters)
      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