Package com.groiss.store
Enum Class PersistentAspect
- All Implemented Interfaces:
Serializable
,Comparable<PersistentAspect>
,Constable
Allows to change certain aspects of the behavior of the Store and OrgData operations
on Persistent objects.
Can be set on a thread/transaction level or on individual object level.
Deviations from standard behavior are reset at the end of the transaction.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAutomatically grant all permissions on all objects.Don't change standard fields (createdBy, changedBy, createdAt, changedAt) when a DMSObject is inserted or updated.Avoid checking of deferred updates during update and delete.Avoid writing of Log Information insert and update and delete via OrgData.Avoid deleting of attached object extensions when their referencing persistent is deleted.Avoid checking of transaction id in update.Avoid checking of permissions during insert, update and delete via OrgData.Avoid checking of validation constraints during insert and update. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SilentCloseable
add
(PersistentAspect... aspects) Add the PersistentAspects at thread level.static SilentCloseable
add
(Persistent p, PersistentAspect... aspects) Add the PersistentAspects for an object.static void
clear()
Clears all PersistentAspects.static void
clear
(Persistent p) Clears all PersistentAspects of an object.static Set<PersistentAspect>
get()
Get the set of currently set PersistentAspects at the thread level.static Set<PersistentAspect>
get
(Persistent p) Get the set of currently set PersistentAspects for an object.static Set<PersistentAspect>
Get the set of currently set PersistentAspects for an object.static boolean
isSet
(PersistentAspect aspect) Checks if a PersistentAspect is active at the thread level.static boolean
isSet
(Persistent p, PersistentAspect aspect) Checks if a PersistentAspect is active for an object.static boolean
isSetForObject
(Persistent p, PersistentAspect aspect) Checks if a PersistentAspect is active for an object.static SilentCloseable
remove
(PersistentAspect... aspects) Remove the PersistentAspects at thread level.static SilentCloseable
remove
(Persistent p, PersistentAspect... aspects) Remove the PersistentAspects from an object.static void
set
(Persistent p, Set<PersistentAspect> aspects) Set the PersistentAspects for an object.static void
set
(Set<PersistentAspect> aspects) Set the PersistentAspects at the thread level.static PersistentAspect
Returns the enum constant of this class with the specified name.static PersistentAspect[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_OPTLOCKING
Avoid checking of transaction id in update. Via Store forOptimisticLocking
.In former times used on Thread Level;
- on: ThreadContext.setAttribute(StoreEJB.IGNORE_TRANSACTION_ID,true);
- off: ThreadContext.removeAttribute(StoreEJB.IGNORE_TRANSACTION_ID);
-
NO_DEFERREDCHECK
Avoid checking of deferred updates during update and delete. Done via Store for HasDeferredChange.In former times used on Thread Level:
- on: ThreadContext.setAttribute(LoggedObject.NO_CHECK_DEFERRED, Boolean.TRUE);
- off: ThreadContext.removeAttribute(LoggedObject.NO_CHECK_DEFERRED);
-
NO_VALIDATION
Avoid checking of validation constraints during insert and update. PersistentObject.beforeInsert and beforeUpdate methods check this to avoid calling of PersistentObject.isValid(). Other Persistent classes (which do not extend PersistentObject) have to implement a corresponding behavior themselves.In former times used on Thread Level:
- on: ThreadContext.setAttribute(SQLObject.DO_BLIND, Boolean.TRUE);
- off: ThreadContext.removeAttribute(SQLObject.DO_BLIND);
-
NO_PERMISSIONCHECK
Avoid checking of permissions during insert, update and delete via OrgData. OrgData.insert/update/delete methods check this to avoid calling of OrgData.mayXXX(). Contrast withALL_PERMISSIONS
.In former times used on object level:
- LoggedObject.insert/update/deleteNocheck(p);
-
NO_LOG
Avoid writing of Log Information insert and update and delete via OrgData. OrgData.insert/update/delete methods check this to avoid calling of OrgData.makeLog()In former times used on object level:
- LoggedObject.insert/update/deleteNocheck(p);
-
NO_OBJECTEXTENSIONCLEANUP
Avoid deleting of attached object extensions when their referencing persistent is deleted. -
ALL_PERMISSIONS
Automatically grant all permissions on all objects. Be sure to use this feature responsibly and as sparingly as possible. Contrast withNO_PERMISSIONCHECK
.Is honored solely at thread level. Setting this on individual objects has no effect whatsoever.
-
NO_CHANGE_SYSTEMFIELDS
Don't change standard fields (createdBy, changedBy, createdAt, changedAt) when a DMSObject is inserted or updated.In former times used on object level:
- com.dec.avw.core.Form.disableAutoUpdate() to set and
- com.dec.avw.core.Form.enableAutoUpdate() to remove the aspect
-
-
Field Details
-
logger
public static final org.slf4j.Logger logger
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
get
Get the set of currently set PersistentAspects at the thread level.- Returns:
- a Set of currently active PersistentAspects
-
set
Set the PersistentAspects at the thread level. Currently set object aspect are NOT changed.- Parameters:
aspects
- the Set of PersistentAspects to activate
-
isSet
Checks if a PersistentAspect is active at the thread level.- Parameters:
aspect
- the PersistentAspect to check- Returns:
- true, if the PersistentAspect is set
-
add
Add the PersistentAspects at thread level. Currently set object aspect are NOT changed.- Parameters:
aspects
- the PersistentAspects to add- Returns:
- a SilentCloseable to use in a try(with resource) block
-
remove
Remove the PersistentAspects at thread level. Currently set object aspect are NOT changed.- Parameters:
aspects
- the PersistentAspects to remove- Returns:
- a SilentCloseable to use in a try(with resource) block
-
clear
public static void clear()Clears all PersistentAspects. Automatically called at end of transaction. -
get
Get the set of currently set PersistentAspects for an object. Thread level PersistentAspects are accounted for.- Parameters:
p
- the Persistent for which to get the PersistentAspects- Returns:
- an EnumSet of currently active PersistentAspects for this Persistent
-
getForObject
Get the set of currently set PersistentAspects for an object. Thread level PersistentAspects are NOT accounted for.- Parameters:
p
- the Persistent for which to get the PersistentAspects- Returns:
- an EnumSet of currently active PersistentAspects for this Persistent
-
set
Set the PersistentAspects for an object.The oid of the object must have been set before.
- Parameters:
p
- the Persistent for which to set the PersistentAspectsaspects
- the EnumSet of PersistentAspects to activate
-
isSet
Checks if a PersistentAspect is active for an object. Thread level PersistentAspects are accounted for.- Parameters:
aspect
- the PersistentAspect to checkp
- the Persistent to check for- Returns:
- true, if the PersistentAspect is set for the object
-
isSetForObject
Checks if a PersistentAspect is active for an object. Thread level PersistentAspects are NOT accounted for.- Parameters:
aspect
- the PersistentAspect to checkp
- the Persistent to check for- Returns:
- true, if the PersistentAspect is set for the object
-
add
Add the PersistentAspects for an object.The oid of the object must have been set before.
- Parameters:
p
- the Persistent for which to add the PersistentAspectsaspects
- the PersistentAspects to add- Returns:
- a SilentCloseable to use in a try(with resource) block
-
remove
Remove the PersistentAspects from an object.- Parameters:
p
- the Persistent from which to remove the PersistentAspectsaspects
- the PersistentAspects to remove- Returns:
- a SilentCloseable to use in a try(with resource) block
-
clear
Clears all PersistentAspects of an object.- Parameters:
p
- the object to clear all persistent aspects for
-