Package org.apache.openjpa.enhance
Interface StateManager
- All Known Subinterfaces:
OpenJPAStateManager
- All Known Implementing Classes:
DetachedStateManager,DetachedValueStateManager,ObjectIdStateManager,StateManagerImpl
public interface StateManager
Internal state manager for managed instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidaccessingField(int idx) Field access callback.voidMake named field dirty.Return the object id, assigning it if necessary.Persistence context.getPCPrimaryKey(Object oid, int field) Return the persistence-capable primary key object by extracting the identity value of the related instance stored in the given field from the given object id.Returns the optimistic version for this instance.booleanWhether the instance is deleted in this transaction.booleanWhether the instance is detached (i.e. this manager is a detached state manager)booleanisDirty()Whether the instance has been modified in this transaction.booleanisNew()Whether the instance is newly-persisted in this transaction.booleanWhether the instance is persistent.booleanWhether the instance is transactional.voidprovidedBooleanField(PersistenceCapable pc, int idx, boolean cur) Provide state callback.voidprovidedByteField(PersistenceCapable pc, int idx, byte cur) Provide state callback.voidprovidedCharField(PersistenceCapable pc, int idx, char cur) Provide state callback.voidprovidedDoubleField(PersistenceCapable pc, int idx, double cur) Provide state callback.voidprovidedFloatField(PersistenceCapable pc, int idx, float cur) Provide state callback.voidprovidedIntField(PersistenceCapable pc, int idx, int cur) Provide state callback.voidprovidedLongField(PersistenceCapable pc, int idx, long cur) Provide state callback.voidprovidedObjectField(PersistenceCapable pc, int idx, Object cur) Provide state callback.voidprovidedShortField(PersistenceCapable pc, int idx, short cur) Provide state callback.voidprovidedStringField(PersistenceCapable pc, int idx, String cur) Provide state callback.voidproxyDetachedDeserialized(int idx) Proxy the given detached field after deserialization.booleanreplaceBooleanField(PersistenceCapable pc, int idx) Replace state callback.bytereplaceByteField(PersistenceCapable pc, int idx) Replace state callback.charreplaceCharField(PersistenceCapable pc, int idx) Replace state callback.doublereplaceDoubleField(PersistenceCapable pc, int idx) Replace state callback.floatreplaceFloatField(PersistenceCapable pc, int idx) Replace state callback.intreplaceIntField(PersistenceCapable pc, int idx) Replace state callback.longreplaceLongField(PersistenceCapable pc, int idx) Replace state callback.replaceObjectField(PersistenceCapable pc, int idx) Replace state callback.shortreplaceShortField(PersistenceCapable pc, int idx) Replace state callback.Change state manager.replaceStringField(PersistenceCapable pc, int idx) Replace state callback.booleanCallback to prepare instance for serialization.voidsettingBooleanField(PersistenceCapable pc, int idx, boolean cur, boolean next, int set) Setting state callback.voidsettingByteField(PersistenceCapable pc, int idx, byte cur, byte next, int set) Setting state callback.voidsettingCharField(PersistenceCapable pc, int idx, char cur, char next, int set) Setting state callback.voidsettingDoubleField(PersistenceCapable pc, int idx, double cur, double next, int set) Setting state callback.voidsettingFloatField(PersistenceCapable pc, int idx, float cur, float next, int set) Setting state callback.voidsettingIntField(PersistenceCapable pc, int idx, int cur, int next, int set) Setting state callback.voidsettingLongField(PersistenceCapable pc, int idx, long cur, long next, int set) Setting state callback.voidsettingObjectField(PersistenceCapable pc, int idx, Object cur, Object next, int set) Setting state callback.voidsettingShortField(PersistenceCapable pc, int idx, short cur, short next, int set) Setting state callback.voidsettingStringField(PersistenceCapable pc, int idx, String cur, String next, int set) Setting state callback.booleanWrite detached state object and detached state manager to the given stream.
-
Field Details
-
SET_USER
static final int SET_USER- See Also:
-
SET_REMOTE
static final int SET_REMOTE- See Also:
-
SET_ATTACH
static final int SET_ATTACH- See Also:
-
-
Method Details
-
getGenericContext
Object getGenericContext()Persistence context. -
getPCPrimaryKey
Return the persistence-capable primary key object by extracting the identity value of the related instance stored in the given field from the given object id. -
replaceStateManager
Change state manager. -
getVersion
Object getVersion()Returns the optimistic version for this instance. -
isDirty
boolean isDirty()Whether the instance has been modified in this transaction. -
isTransactional
boolean isTransactional()Whether the instance is transactional. -
isPersistent
boolean isPersistent()Whether the instance is persistent. -
isNew
boolean isNew()Whether the instance is newly-persisted in this transaction. -
isDeleted
boolean isDeleted()Whether the instance is deleted in this transaction. -
isDetached
boolean isDetached()Whether the instance is detached (i.e. this manager is a detached state manager) -
dirty
Make named field dirty. -
fetchObjectId
Object fetchObjectId()Return the object id, assigning it if necessary. -
serializing
boolean serializing()Callback to prepare instance for serialization.- Returns:
- true to null detached state after serialize
-
writeDetached
Write detached state object and detached state manager to the given stream.- Returns:
- true if managed fields also written to stream
- Throws:
IOException
-
proxyDetachedDeserialized
void proxyDetachedDeserialized(int idx) Proxy the given detached field after deserialization. -
accessingField
void accessingField(int idx) Field access callback. -
settingBooleanField
Setting state callback. -
settingCharField
Setting state callback. -
settingByteField
Setting state callback. -
settingShortField
Setting state callback. -
settingIntField
Setting state callback. -
settingLongField
Setting state callback. -
settingFloatField
Setting state callback. -
settingDoubleField
Setting state callback. -
settingStringField
Setting state callback. -
settingObjectField
Setting state callback. -
providedBooleanField
Provide state callback. -
providedCharField
Provide state callback. -
providedByteField
Provide state callback. -
providedShortField
Provide state callback. -
providedIntField
Provide state callback. -
providedLongField
Provide state callback. -
providedFloatField
Provide state callback. -
providedDoubleField
Provide state callback. -
providedStringField
Provide state callback. -
providedObjectField
Provide state callback. -
replaceBooleanField
Replace state callback. -
replaceCharField
Replace state callback. -
replaceByteField
Replace state callback. -
replaceShortField
Replace state callback. -
replaceIntField
Replace state callback. -
replaceLongField
Replace state callback. -
replaceFloatField
Replace state callback. -
replaceDoubleField
Replace state callback. -
replaceStringField
Replace state callback. -
replaceObjectField
Replace state callback.
-