org.electrocodeogram.cpc.core.api.data.special
Interface ICloneObjectExtensionStatefulObject

All Superinterfaces:
java.lang.Cloneable, ICloneDataElement, ICloneObjectExtension, IStatefulObject, java.io.Serializable
All Known Subinterfaces:
ICloneObjectExtensionLazyMultiStatefulObject, ICloneObjectExtensionMultiStatefulObject

public interface ICloneObjectExtensionStatefulObject
extends IStatefulObject, ICloneObjectExtension

A special version of the IStatefulObject interface which needs to be implemented by all ICloneObjectExtension objects which require persistence.

If you need to persist extension objects which contain lists of arbitrary length or complex content, please refer to the ICloneObjectExtensionMultiStatefulObject API.

There are a number of important differences between the normal IStatefulObject handling for ICloneObjects & co and the handling for ICloneObjectExtensions.


NOTE: In the current implementation stateful extensions are only meaningful for IClone objects.

Author:
vw
See Also:
ICloneObjectExtensionMultiStatefulObject, IStatefulObject, ICloneObjectExtension

Field Summary
static java.lang.String PERSISTENCE_OBJECT_IDENTIFIER
           
 
Method Summary
 java.lang.String getPersistenceParentClassIdentifier()
          Each ICloneObjectExtensionStatefulObject implementation has to be linked to one specific ICloneObject type.
 boolean isDirty()
          Checks whether this ICloneObjectExtensionStatefulObject instance was modified in a way which affected the persistent part of its data.
 void setDirty(boolean dirty)
          Called by the IStoreProvider (with value false) after this extension was successfully persisted.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.special.IStatefulObject
getPersistenceClassIdentifier, getPersistenceObjectIdentifier, getState, getStateTypes, setState
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneObjectExtension
clone, getExtensionInterfaceClass, isPartial, setParentUuid, toString
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneDataElement
isSealed, seal
 

Field Detail

PERSISTENCE_OBJECT_IDENTIFIER

static final java.lang.String PERSISTENCE_OBJECT_IDENTIFIER
See Also:
IStatefulObject.getPersistenceClassIdentifier(), Constant Field Values
Method Detail

getPersistenceParentClassIdentifier

java.lang.String getPersistenceParentClassIdentifier()
Each ICloneObjectExtensionStatefulObject implementation has to be linked to one specific ICloneObject type.
This method must return the PERSISTENCE_CLASS_IDENTIFIER value of that class.
I.e. IClone.PERSISTENCE_CLASS_IDENTIFIER.

Returns:
the IStatefulObject.getPersistenceClassIdentifier() of the parent entity type, never null.

isDirty

boolean isDirty()
Checks whether this ICloneObjectExtensionStatefulObject instance was modified in a way which affected the persistent part of its data.
This should be true if and only if a modification has taken place which might have resulted in a change of the IStatefulObject.getState() return value.

For ICloneObjectExtensionMultiStatefulObject implementations, true should also be returned if a modification might have changed the return value of ICloneObjectExtensionMultiStatefulObject.getMultiState().

Returns:
true if this instance was modified in any way which needs to be persisted, false otherwise.

setDirty

void setDirty(boolean dirty)
Called by the IStoreProvider (with value false) after this extension was successfully persisted.

IMPORTANT: this method may only be called internally or by the IStoreProvider.

Parameters:
dirty - true if this entry is out of sync and needs to be persisted, false otherwise.