Interface EntityViewMapping
public interface EntityViewMapping
A mapping for an entity view type.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and Type Method Description Map<String,EntityViewAttributeMapping>
getAttributes()
Returns the attribute mappings defined for this entity view mapping.Map<String,EntityViewConstructorMapping>
getConstructors()
Returns the constructor mappings defined for this entity view mapping.Class<?>
getEntityClass()
The JPA managed type class for which this entity view mapping is defined.Class<?>
getEntityViewClass()
The type represented by this entity view mapping.FlushMode
getFlushMode()
Returns the flush mode to use for updates ornull
if the entity view should not be updatable.FlushStrategy
getFlushStrategy()
Returns the flush strategy to use for updates ornull
if the entity view should not be updatable.EntityViewAttributeMapping
getIdAttribute()
Returns the id attribute mapping of this entity view mapping ornull
if there is none.LockMode
getLockMode()
Returns the lock mode to use for doing updates ornull
if the entity view should not be updatable.String
getLockOwner()
Returns the lock owner mapping relative to the JPA managed type of this entity view to use for updates ornull
if the entity view should not be updatable.Method
getPostCommitMethod()
Returns the post commit method ornull
if there is none.ViewTransition[]
getPostCommitTransitions()
Returns the post commit view transitions ornull
if there is none.Method
getPostConvertMethod()
Returns the post convert method ornull
if there is none.Method
getPostCreateMethod()
Returns the post create method ornull
if there is none.Method
getPostLoadMethod()
Returns the post load method ornull
if there is none.Method
getPostPersistMethod()
Returns the post persist method ornull
if there is none.Method
getPostRemoveMethod()
Returns the post remove method ornull
if there is none.Method
getPostRollbackMethod()
Returns the post rollback method ornull
if there is none.ViewTransition[]
getPostRollbackTransitions()
Returns the post rollback view transitions ornull
if there is none.Method
getPostUpdateMethod()
Returns the post update method ornull
if there is none.Method
getPrePersistMethod()
Returns the pre persist method ornull
if there is none.Method
getPreRemoveMethod()
Returns the pre remove method ornull
if there is none.Method
getPreUpdateMethod()
Returns the pre update method ornull
if there is none.EntityViewAttributeMapping
getVersionAttribute()
Returns the version attribute mapping of this entity view mapping ornull
if ther is none.boolean
isCreatable()
Returns whether the entity view should be creatable i.e. support persist viaEntityViewManager.save(EntityManager, Object)
.boolean
isUpdatable()
Returns whether the entity view should be updatable i.e. support updates viaEntityViewManager.save(EntityManager, Object)
.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.void
setCreatable(boolean creatable)
Set whether the entity view should be creatable.void
setEntityClass(Class<?> entityClass)
Set the JPA managed type class for this entity view mapping.void
setFlushMode(FlushMode flushMode)
Set the flush mode to use for updates.void
setFlushStrategy(FlushStrategy flushStrategy)
Set the flush strategy to use for updates.void
setIdAttribute(EntityViewAttributeMapping idAttribute)
Set the id attribute mapping of this entity view mapping.void
setLockMode(LockMode lockMode)
Set the lock mode to use for updates.void
setLockOwner(String lockOwner)
Set the lock owner mapping relative to the JPA managed type of this entity view.void
setPostCommitMethod(Method postCommitMethod)
Sets the post commit method.void
setPostCommitTransitions(ViewTransition[] viewTransitions)
Sets the post commit view transitions.void
setPostConvertMethod(Method postConvertMethod)
Sets the post convert method.void
setPostCreateMethod(Method postCreateMethod)
Sets the post create method.void
setPostLoadMethod(Method postLoadMethod)
Sets the post load method.void
setPostPersistMethod(Method postPersistMethod)
Sets the post persist method.void
setPostRemoveMethod(Method postRemoveMethod)
Sets the post remove method.void
setPostRollbackMethod(Method postRollbackMethod)
Sets the post rollback method.void
setPostRollbackTransitions(ViewTransition[] viewTransitions)
Sets the post rollback view transitions.void
setPostUpdateMethod(Method postUpdateMethod)
Sets the post update method.void
setPrePersistMethod(Method prePersistMethod)
Sets the pre persist method.void
setPreRemoveMethod(Method preRemoveMethod)
Sets the pre remove method.void
setPreUpdateMethod(Method preUpdateMethod)
Sets the pre update method.void
setUpdatable(boolean updatable)
Set whether the entity view should be updatable.void
setValidatePersistability(boolean validatePersistability)
Set whether the entity view should be validated regarding it's persistability.void
setVersionAttribute(EntityViewAttributeMapping versionAttribute)
Set the version attribute mapping of this entity view mapping.
-
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
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 viaEntityViewManager.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 ornull
if the entity view should not be updatable.- Returns:
- The lock mode for updates
-
setLockMode
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 ornull
if the entity view should not be updatable.- Returns:
- The lock owner for updates
-
setLockOwner
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 ornull
if the entity view should not be updatable.- Returns:
- The flush mode for updates
-
setFlushMode
Set the flush mode to use for updates.- Parameters:
flushMode
- The flush mode
-
getFlushStrategy
FlushStrategy getFlushStrategy()Returns the flush strategy to use for updates ornull
if the entity view should not be updatable.- Returns:
- The flush strategy for updates
-
setFlushStrategy
Set the flush strategy to use for updates.- Parameters:
flushStrategy
- The flush strategy
-
getPostCreateMethod
Method getPostCreateMethod()Returns the post create method ornull
if there is none.- Returns:
- The post create method
-
setPostCreateMethod
Sets the post create method.- Parameters:
postCreateMethod
- The method
-
getPostConvertMethod
Method getPostConvertMethod()Returns the post convert method ornull
if there is none.- Returns:
- The post convert method
- Since:
- 1.4.0
-
setPostConvertMethod
Sets the post convert method.- Parameters:
postConvertMethod
- The method- Since:
- 1.4.0
-
getPostLoadMethod
Method getPostLoadMethod()Returns the post load method ornull
if there is none.- Returns:
- The post load method
- Since:
- 1.5.0
-
setPostLoadMethod
Sets the post load method.- Parameters:
postLoadMethod
- The method- Since:
- 1.5.0
-
getPrePersistMethod
Method getPrePersistMethod()Returns the pre persist method ornull
if there is none.- Returns:
- The pre persist method
- Since:
- 1.4.0
-
setPrePersistMethod
Sets the pre persist method.- Parameters:
prePersistMethod
- The method- Since:
- 1.4.0
-
getPostPersistMethod
Method getPostPersistMethod()Returns the post persist method ornull
if there is none.- Returns:
- The post persist method
- Since:
- 1.4.0
-
setPostPersistMethod
Sets the post persist method.- Parameters:
postPersistMethod
- The method- Since:
- 1.4.0
-
getPreUpdateMethod
Method getPreUpdateMethod()Returns the pre update method ornull
if there is none.- Returns:
- The pre update method
- Since:
- 1.4.0
-
setPreUpdateMethod
Sets the pre update method.- Parameters:
preUpdateMethod
- The method- Since:
- 1.4.0
-
getPostUpdateMethod
Method getPostUpdateMethod()Returns the post update method ornull
if there is none.- Returns:
- The post update method
- Since:
- 1.4.0
-
setPostUpdateMethod
Sets the post update method.- Parameters:
postUpdateMethod
- The method- Since:
- 1.4.0
-
getPreRemoveMethod
Method getPreRemoveMethod()Returns the pre remove method ornull
if there is none.- Returns:
- The pre remove method
- Since:
- 1.4.0
-
setPreRemoveMethod
Sets the pre remove method.- Parameters:
preRemoveMethod
- The method- Since:
- 1.4.0
-
getPostRemoveMethod
Method getPostRemoveMethod()Returns the post remove method ornull
if there is none.- Returns:
- The post remove method
- Since:
- 1.4.0
-
setPostRemoveMethod
Sets the post remove method.- Parameters:
postRemoveMethod
- The method- Since:
- 1.4.0
-
getPostRollbackMethod
Method getPostRollbackMethod()Returns the post rollback method ornull
if there is none.- Returns:
- The post rollback method
- Since:
- 1.4.0
-
setPostRollbackMethod
Sets the post rollback method.- Parameters:
postRollbackMethod
- The method- Since:
- 1.4.0
-
getPostCommitMethod
Method getPostCommitMethod()Returns the post commit method ornull
if there is none.- Returns:
- The post commit method
- Since:
- 1.4.0
-
setPostCommitMethod
Sets the post commit method.- Parameters:
postCommitMethod
- The method- Since:
- 1.4.0
-
getPostRollbackTransitions
ViewTransition[] getPostRollbackTransitions()Returns the post rollback view transitions ornull
if there is none.- Returns:
- The post rollback view transitions
- Since:
- 1.4.0
-
setPostRollbackTransitions
Sets the post rollback view transitions.- Parameters:
viewTransitions
- The view transitions- Since:
- 1.4.0
-
getPostCommitTransitions
ViewTransition[] getPostCommitTransitions()Returns the post commit view transitions ornull
if there is none.- Returns:
- The post commit view transitions
- Since:
- 1.4.0
-
setPostCommitTransitions
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 viaEntityViewManager.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 ornull
if there is none.- Returns:
- The id attribute mapping or
null
if there is none
-
setIdAttribute
Set the id attribute mapping of this entity view mapping. Note that the attribute must be one of the attributes as given bygetAttributes()
ornull
.- Parameters:
idAttribute
- The id attribute mapping
-
getVersionAttribute
EntityViewAttributeMapping getVersionAttribute()Returns the version attribute mapping of this entity view mapping ornull
if ther is none.- Returns:
- The version attribute mapping or
null
if there is none
-
setVersionAttribute
Set the version attribute mapping of this entity view mapping. Note that the attribute must be one of the attributes as given bygetAttributes()
ornull
.- Parameters:
versionAttribute
- The version attribute mapping
-
getAttributes
Map<String,EntityViewAttributeMapping> 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
-