Interface EntityViewMapping


public interface EntityViewMapping
A mapping for an entity view type.
Since:
1.2.0
Author:
Christian Beikov
  • Method Details

    • getEntityViewClass

      Class<?> getEntityViewClass()
      The type represented by this entity view mapping.
      Returns:
      The entity view type
    • getEntityClass

      Class<?> getEntityClass()
      The JPA managed type class for which this entity view mapping is defined.
      Returns:
      The JPA managed type class
    • setEntityClass

      void setEntityClass​(Class<?> entityClass)
      Set the JPA managed type class for this entity view mapping.
      Parameters:
      entityClass - The JPA managed type class
    • isUpdatable

      boolean isUpdatable()
      Returns whether the entity view should be updatable i.e. support updates via EntityViewManager.save(EntityManager, Object).
      Returns:
      Whether the entity view should be updatable
    • setUpdatable

      void setUpdatable​(boolean updatable)
      Set whether the entity view should be updatable.
      Parameters:
      updatable - Whether the entity view should be updatable
    • getLockMode

      LockMode getLockMode()
      Returns the lock mode to use for doing updates or null if the entity view should not be updatable.
      Returns:
      The lock mode for updates
    • setLockMode

      void setLockMode​(LockMode lockMode)
      Set the lock mode to use for updates.
      Parameters:
      lockMode - The lock mode
    • getLockOwner

      String getLockOwner()
      Returns the lock owner mapping relative to the JPA managed type of this entity view to use for updates or null if the entity view should not be updatable.
      Returns:
      The lock owner for updates
    • setLockOwner

      void setLockOwner​(String lockOwner)
      Set the lock owner mapping relative to the JPA managed type of this entity view.
      Parameters:
      lockOwner - The lock owner mapping
    • getFlushMode

      FlushMode getFlushMode()
      Returns the flush mode to use for updates or null if the entity view should not be updatable.
      Returns:
      The flush mode for updates
    • setFlushMode

      void setFlushMode​(FlushMode flushMode)
      Set the flush mode to use for updates.
      Parameters:
      flushMode - The flush mode
    • getFlushStrategy

      FlushStrategy getFlushStrategy()
      Returns the flush strategy to use for updates or null if the entity view should not be updatable.
      Returns:
      The flush strategy for updates
    • setFlushStrategy

      void setFlushStrategy​(FlushStrategy flushStrategy)
      Set the flush strategy to use for updates.
      Parameters:
      flushStrategy - The flush strategy
    • getPostCreateMethod

      Method getPostCreateMethod()
      Returns the post create method or null if there is none.
      Returns:
      The post create method
    • setPostCreateMethod

      void setPostCreateMethod​(Method postCreateMethod)
      Sets the post create method.
      Parameters:
      postCreateMethod - The method
    • getPostConvertMethod

      Method getPostConvertMethod()
      Returns the post convert method or null if there is none.
      Returns:
      The post convert method
      Since:
      1.4.0
    • setPostConvertMethod

      void setPostConvertMethod​(Method postConvertMethod)
      Sets the post convert method.
      Parameters:
      postConvertMethod - The method
      Since:
      1.4.0
    • getPostLoadMethod

      Method getPostLoadMethod()
      Returns the post load method or null if there is none.
      Returns:
      The post load method
      Since:
      1.5.0
    • setPostLoadMethod

      void setPostLoadMethod​(Method postLoadMethod)
      Sets the post load method.
      Parameters:
      postLoadMethod - The method
      Since:
      1.5.0
    • getPrePersistMethod

      Method getPrePersistMethod()
      Returns the pre persist method or null if there is none.
      Returns:
      The pre persist method
      Since:
      1.4.0
    • setPrePersistMethod

      void setPrePersistMethod​(Method prePersistMethod)
      Sets the pre persist method.
      Parameters:
      prePersistMethod - The method
      Since:
      1.4.0
    • getPostPersistMethod

      Method getPostPersistMethod()
      Returns the post persist method or null if there is none.
      Returns:
      The post persist method
      Since:
      1.4.0
    • setPostPersistMethod

      void setPostPersistMethod​(Method postPersistMethod)
      Sets the post persist method.
      Parameters:
      postPersistMethod - The method
      Since:
      1.4.0
    • getPreUpdateMethod

      Method getPreUpdateMethod()
      Returns the pre update method or null if there is none.
      Returns:
      The pre update method
      Since:
      1.4.0
    • setPreUpdateMethod

      void setPreUpdateMethod​(Method preUpdateMethod)
      Sets the pre update method.
      Parameters:
      preUpdateMethod - The method
      Since:
      1.4.0
    • getPostUpdateMethod

      Method getPostUpdateMethod()
      Returns the post update method or null if there is none.
      Returns:
      The post update method
      Since:
      1.4.0
    • setPostUpdateMethod

      void setPostUpdateMethod​(Method postUpdateMethod)
      Sets the post update method.
      Parameters:
      postUpdateMethod - The method
      Since:
      1.4.0
    • getPreRemoveMethod

      Method getPreRemoveMethod()
      Returns the pre remove method or null if there is none.
      Returns:
      The pre remove method
      Since:
      1.4.0
    • setPreRemoveMethod

      void setPreRemoveMethod​(Method preRemoveMethod)
      Sets the pre remove method.
      Parameters:
      preRemoveMethod - The method
      Since:
      1.4.0
    • getPostRemoveMethod

      Method getPostRemoveMethod()
      Returns the post remove method or null if there is none.
      Returns:
      The post remove method
      Since:
      1.4.0
    • setPostRemoveMethod

      void setPostRemoveMethod​(Method postRemoveMethod)
      Sets the post remove method.
      Parameters:
      postRemoveMethod - The method
      Since:
      1.4.0
    • getPostRollbackMethod

      Method getPostRollbackMethod()
      Returns the post rollback method or null if there is none.
      Returns:
      The post rollback method
      Since:
      1.4.0
    • setPostRollbackMethod

      void setPostRollbackMethod​(Method postRollbackMethod)
      Sets the post rollback method.
      Parameters:
      postRollbackMethod - The method
      Since:
      1.4.0
    • getPostCommitMethod

      Method getPostCommitMethod()
      Returns the post commit method or null if there is none.
      Returns:
      The post commit method
      Since:
      1.4.0
    • setPostCommitMethod

      void setPostCommitMethod​(Method postCommitMethod)
      Sets the post commit method.
      Parameters:
      postCommitMethod - The method
      Since:
      1.4.0
    • getPostRollbackTransitions

      ViewTransition[] getPostRollbackTransitions()
      Returns the post rollback view transitions or null if there is none.
      Returns:
      The post rollback view transitions
      Since:
      1.4.0
    • setPostRollbackTransitions

      void setPostRollbackTransitions​(ViewTransition[] viewTransitions)
      Sets the post rollback view transitions.
      Parameters:
      viewTransitions - The view transitions
      Since:
      1.4.0
    • getPostCommitTransitions

      ViewTransition[] getPostCommitTransitions()
      Returns the post commit view transitions or null if there is none.
      Returns:
      The post commit view transitions
      Since:
      1.4.0
    • setPostCommitTransitions

      void setPostCommitTransitions​(ViewTransition[] viewTransitions)
      Sets the post commit view transitions.
      Parameters:
      viewTransitions - The view transitions
      Since:
      1.4.0
    • isCreatable

      boolean isCreatable()
      Returns whether the entity view should be creatable i.e. support persist via EntityViewManager.save(EntityManager, Object).
      Returns:
      Whether the entity view should be creatable
    • setCreatable

      void setCreatable​(boolean creatable)
      Set whether the entity view should be creatable.
      Parameters:
      creatable - Whether the entity view should be creatable
    • isValidatePersistability

      boolean isValidatePersistability()
      Returns whether the persistability of an entity view should be validated i.e. check if an entity could be successfully persisted based on the settable attributes.
      Returns:
      Whether the persistability of an entity view should be validated
    • setValidatePersistability

      void setValidatePersistability​(boolean validatePersistability)
      Set whether the entity view should be validated regarding it's persistability.
      Parameters:
      validatePersistability - Whether the entity view should be validated regarding it's persistability
    • getIdAttribute

      EntityViewAttributeMapping getIdAttribute()
      Returns the id attribute mapping of this entity view mapping or null if there is none.
      Returns:
      The id attribute mapping or null if there is none
    • setIdAttribute

      void setIdAttribute​(EntityViewAttributeMapping idAttribute)
      Set the id attribute mapping of this entity view mapping. Note that the attribute must be one of the attributes as given by getAttributes() or null.
      Parameters:
      idAttribute - The id attribute mapping
    • getVersionAttribute

      EntityViewAttributeMapping getVersionAttribute()
      Returns the version attribute mapping of this entity view mapping or null if ther is none.
      Returns:
      The version attribute mapping or null if there is none
    • setVersionAttribute

      void setVersionAttribute​(EntityViewAttributeMapping versionAttribute)
      Set the version attribute mapping of this entity view mapping. Note that the attribute must be one of the attributes as given by getAttributes() or null.
      Parameters:
      versionAttribute - The version attribute mapping
    • getAttributes

      Returns the attribute mappings defined for this entity view mapping.
      Returns:
      The defined attribute mappings
    • getConstructors

      Map<String,​EntityViewConstructorMapping> getConstructors()
      Returns the constructor mappings defined for this entity view mapping.
      Returns:
      The defined constructor mappings