Class JPAEntityListVariableType
- java.lang.Object
-
- org.activiti.engine.impl.variable.JPAEntityListVariableType
-
- All Implemented Interfaces:
CacheableVariable,VariableType
- Direct Known Subclasses:
HistoricJPAEntityListVariableType
public class JPAEntityListVariableType extends java.lang.Object implements VariableType, CacheableVariable
Variable type capable of storing a list of reference to JPA-entities. Only JPA-Entities which are configured by annotations are supported. Use of compound primary keys is not supported.
The variable value should be of typeListand can only contain objects of the same type.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanforceCachedValueprotected JPAEntityMappingsmappingsstatic java.lang.StringTYPE_NAME
-
Constructor Summary
Constructors Constructor Description JPAEntityListVariableType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]deserializeIds(byte[] bytes)java.lang.StringgetTypeName()name of variable type (limited to 100 characters length)java.lang.ObjectgetValue(ValueFields valueFields)booleanisAbleToStore(java.lang.Object value)booleanisCachable()Indicates if this variable type supports caching.protected byte[]serializeIds(java.util.List<java.lang.String> ids)voidsetForceCacheable(boolean forceCachedValue)voidsetValue(java.lang.Object value, ValueFields valueFields)Stores the specified value in the suppliedValueFields.
-
-
-
Field Detail
-
TYPE_NAME
public static final java.lang.String TYPE_NAME
- See Also:
- Constant Field Values
-
mappings
protected JPAEntityMappings mappings
-
forceCachedValue
protected boolean forceCachedValue
-
-
Method Detail
-
setForceCacheable
public void setForceCacheable(boolean forceCachedValue)
- Specified by:
setForceCacheablein interfaceCacheableVariable
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:VariableTypename of variable type (limited to 100 characters length)- Specified by:
getTypeNamein interfaceVariableType
-
isCachable
public boolean isCachable()
Description copied from interface:VariableTypeIndicates if this variable type supports caching.
If caching is supported, the result of
VariableType.getValue(ValueFields)is saved for the duration of the session and used for subsequent reads of the variable's value.If caching is not supported, all reads of a variable's value require a fresh call to
VariableType.getValue(ValueFields).- Specified by:
isCachablein interfaceVariableType- Returns:
- whether variables of this type are cacheable.
-
isAbleToStore
public boolean isAbleToStore(java.lang.Object value)
- Specified by:
isAbleToStorein interfaceVariableType- Returns:
- whether this variable type can store the specified value.
-
setValue
public void setValue(java.lang.Object value, ValueFields valueFields)Description copied from interface:VariableTypeStores the specified value in the suppliedValueFields.- Specified by:
setValuein interfaceVariableType
-
getValue
public java.lang.Object getValue(ValueFields valueFields)
- Specified by:
getValuein interfaceVariableType- Returns:
- the value of a variable based on the specified
ValueFields.
-
serializeIds
protected byte[] serializeIds(java.util.List<java.lang.String> ids)
- Returns:
- a bytearray containing all ID's in the given string serialized as an array.
-
deserializeIds
protected java.lang.String[] deserializeIds(byte[] bytes)
-
-