org.datanucleus.store
Interface ObjectProvider

All Known Implementing Classes:
ObjectProviderImpl

public interface ObjectProvider

Provides fields. TODO Provide proper javadoc telling people what this is actually for, and documenting each method.


Field Summary
static short EMBEDDED_COLLECTION_ELEMENT_PC
          Embedded (or serialised) Collection Element PC
static short EMBEDDED_MAP_KEY_PC
          Embedded (or serialised) Map Key PC
static short EMBEDDED_MAP_VALUE_PC
          Embedded (or serialised) Map Value PC
static short EMBEDDED_PC
          Embedded (or serialised) PC
static short PC
          PC
 
Method Summary
 void addEmbeddedOwner(ObjectProvider ownerSM, int ownerFieldNumber)
          Method to register an owner StateManager with this embedded/serialised object.
 boolean becomingDeleted()
           
 void changeActivityState(ActivityState inserting)
           
 void copyFieldsFromObject(java.lang.Object pc, int[] fieldNumbers)
          Convenience method to update our object with the field values from the passed object.
 void flush()
           
 boolean getAllFieldsLoaded()
           
 java.lang.Object getAssociatedValue(JavaTypeMapping mapping)
           
 AbstractClassMetaData getClassMetaData()
           
 java.lang.String[] getDirtyFieldNames()
          Accessor for the names of the fields that are dirty.
 int[] getDirtyFieldNumbers()
          Accessor for the field numbers of all dirty fields.
 ObjectProvider[] getEmbeddedOwners()
           
 ExecutionContext getExecutionContext()
           
 java.lang.Object getExternalObjectId()
           
 java.lang.Object getInternalObjectId()
           
 LifeCycleState getLifecycleState()
           
 java.lang.String[] getLoadedFieldNames()
           
 int[] getLoadedFieldNumbers()
           
 boolean[] getLoadedFields()
           
 java.lang.Object getObject()
          TODO remove this
 java.lang.Object getObjectId()
           
 short getPcObjectType()
           
 java.lang.Object getReferencedPC()
           
 RelationshipManager getRelationshipManager()
           
 java.lang.Object getTransactionalVersion()
           
 java.lang.Object getVersion()
           
 boolean isDeleting()
           
 boolean isEmbedded()
           
 boolean isInserting()
           
 boolean isLoaded(java.lang.Object object, int absoluteFieldNumber)
           
 boolean isWaitingToBeFlushedToDatastore()
           
 void loadField(int fieldNumber)
           
 void loadFieldFromDatastore(int fieldNumber)
           
 void loadFieldsInFetchPlan(FetchPlanState state)
           
 void loadFieldValues(FieldValues2 fieldValues)
           
 void loadUnloadedFields()
          Fetch from the database all fields that are not currently loaded regardless of whether they are in the current fetch group or not.
 void makeDirty(int field)
          Marks the given field dirty.
 java.lang.Object provideField(int fieldNumber)
           
 void provideFields(int[] fieldNumbers, FieldManager fm)
           
 void replaceAllLoadedSCOFieldsWithValues()
           
 void replaceAllLoadedSCOFieldsWithWrappers()
           
 void replaceField(int fieldNumber, java.lang.Object value)
          Method to change the value of the specified field.
 void replaceFieldMakeDirty(int fieldNumber, java.lang.Object object)
           
 void replaceFields(int[] fieldNumbers, FieldManager fm)
           
 void replaceFields(int[] fieldNumbers, FieldManager fm, boolean b)
           
 void replaceManagedPC(java.lang.Object pc2)
           
 void replaceNonLoadedFields(int[] fieldNumbers, FieldManager fm)
           
 void runReachability(java.util.Set reachables)
           
 void setAssociatedValue(java.lang.Object key, java.lang.Object value)
          Method to set an associated value stored with this object.
 void setObjectField(java.lang.Object newValuePC, int ownerFieldNumber, java.lang.Object oldOwner, java.lang.Object newOwner)
           
 void setPcObjectType(short objectType)
           
 void setPostStoreNewObjectId(java.lang.Object newId)
           
 void setStoringPC()
           
 void setTransactionalVersion(java.lang.Object nextVersion)
           
 void setVersion(java.lang.Object version)
           
 java.lang.String toPrintableID()
           
 void unloadField(java.lang.String name)
           
 void unsetStoringPC()
           
 java.lang.Object unwrapSCOField(int fieldNumber, java.lang.Object value, boolean b)
           
 void updateFieldAfterInsert(java.lang.Object persistable, int fieldNumber)
           
 java.lang.Object wrapSCOField(int fieldNumber, java.lang.Object value, boolean forInsert, boolean forUpdate, boolean replaceFieldIfChanged)
          TODO should not need this method from the store perspective Method to create a new SCO wrapper for the specified field.
 

Field Detail

PC

static final short PC
PC

See Also:
Constant Field Values

EMBEDDED_PC

static final short EMBEDDED_PC
Embedded (or serialised) PC

See Also:
Constant Field Values

EMBEDDED_COLLECTION_ELEMENT_PC

static final short EMBEDDED_COLLECTION_ELEMENT_PC
Embedded (or serialised) Collection Element PC

See Also:
Constant Field Values

EMBEDDED_MAP_KEY_PC

static final short EMBEDDED_MAP_KEY_PC
Embedded (or serialised) Map Key PC

See Also:
Constant Field Values

EMBEDDED_MAP_VALUE_PC

static final short EMBEDDED_MAP_VALUE_PC
Embedded (or serialised) Map Value PC

See Also:
Constant Field Values
Method Detail

getClassMetaData

AbstractClassMetaData getClassMetaData()

replaceField

void replaceField(int fieldNumber,
                  java.lang.Object value)
Method to change the value of the specified field. This will not make the field dirty

Parameters:
fieldNumber - (absolute) field number of the field
value - The new value.

replaceFields

void replaceFields(int[] fieldNumbers,
                   FieldManager fm)

replaceNonLoadedFields

void replaceNonLoadedFields(int[] fieldNumbers,
                            FieldManager fm)

provideFields

void provideFields(int[] fieldNumbers,
                   FieldManager fm)

provideField

java.lang.Object provideField(int fieldNumber)

getExecutionContext

ExecutionContext getExecutionContext()

toPrintableID

java.lang.String toPrintableID()

wrapSCOField

java.lang.Object wrapSCOField(int fieldNumber,
                              java.lang.Object value,
                              boolean forInsert,
                              boolean forUpdate,
                              boolean replaceFieldIfChanged)
TODO should not need this method from the store perspective Method to create a new SCO wrapper for the specified field. If the field is not a SCO field will just return the value.

Parameters:
fieldNumber - The field number
value - The value to initialise the wrapper with (if any)
forInsert - Whether the creation of any wrapper should insert this value into the datastore
forUpdate - Whether the creation of any wrapper should update the datastore with this value
replaceFieldIfChanged - Whether to replace the field in the object if wrapping the value
Returns:
The wrapper (or original value if not wrappable)

getObject

java.lang.Object getObject()
TODO remove this


getInternalObjectId

java.lang.Object getInternalObjectId()

getExternalObjectId

java.lang.Object getExternalObjectId()

setAssociatedValue

void setAssociatedValue(java.lang.Object key,
                        java.lang.Object value)
Method to set an associated value stored with this object. This is for a situation such as in ORM where this object can have an "external" foreign-key provided by an owning object (e.g 1-N uni relation and this is the element with no knowledge of the owner, so the associated value is the FK value).

Parameters:
key - Key for the value
value - The associated value

loadUnloadedFields

void loadUnloadedFields()
Fetch from the database all fields that are not currently loaded regardless of whether they are in the current fetch group or not. Called by lifecycle transitions.


getDirtyFieldNumbers

int[] getDirtyFieldNumbers()
Accessor for the field numbers of all dirty fields.

Returns:
Absolute field numbers of the dirty fields in this instance.

getDirtyFieldNames

java.lang.String[] getDirtyFieldNames()
Accessor for the names of the fields that are dirty.

Returns:
Names of the dirty fields

makeDirty

void makeDirty(int field)
Marks the given field dirty.

Parameters:
field - The no of field to mark as dirty.

isInserting

boolean isInserting()

getEmbeddedOwners

ObjectProvider[] getEmbeddedOwners()

getLifecycleState

LifeCycleState getLifecycleState()

addEmbeddedOwner

void addEmbeddedOwner(ObjectProvider ownerSM,
                      int ownerFieldNumber)
Method to register an owner StateManager with this embedded/serialised object.

Parameters:
ownerSM - The owning State Manager.
ownerFieldNumber - The field number in the owner that the embedded/serialised object is stored as

isEmbedded

boolean isEmbedded()

copyFieldsFromObject

void copyFieldsFromObject(java.lang.Object pc,
                          int[] fieldNumbers)
Convenience method to update our object with the field values from the passed object. Objects need to be of the same type, and the other object should not have a StateManager.

Parameters:
pc - The object that we should copy fields from

getTransactionalVersion

java.lang.Object getTransactionalVersion()

unwrapSCOField

java.lang.Object unwrapSCOField(int fieldNumber,
                                java.lang.Object value,
                                boolean b)

replaceFieldMakeDirty

void replaceFieldMakeDirty(int fieldNumber,
                           java.lang.Object object)

getLoadedFields

boolean[] getLoadedFields()

runReachability

void runReachability(java.util.Set reachables)

setPcObjectType

void setPcObjectType(short objectType)

getPcObjectType

short getPcObjectType()

setStoringPC

void setStoringPC()

flush

void flush()

isWaitingToBeFlushedToDatastore

boolean isWaitingToBeFlushedToDatastore()

isDeleting

boolean isDeleting()

loadFieldValues

void loadFieldValues(FieldValues2 fieldValues)

getRelationshipManager

RelationshipManager getRelationshipManager()

getReferencedPC

java.lang.Object getReferencedPC()

unsetStoringPC

void unsetStoringPC()

setObjectField

void setObjectField(java.lang.Object newValuePC,
                    int ownerFieldNumber,
                    java.lang.Object oldOwner,
                    java.lang.Object newOwner)

loadField

void loadField(int fieldNumber)

isLoaded

boolean isLoaded(java.lang.Object object,
                 int absoluteFieldNumber)

setTransactionalVersion

void setTransactionalVersion(java.lang.Object nextVersion)

replaceFields

void replaceFields(int[] fieldNumbers,
                   FieldManager fm,
                   boolean b)

setVersion

void setVersion(java.lang.Object version)

getLoadedFieldNumbers

int[] getLoadedFieldNumbers()

updateFieldAfterInsert

void updateFieldAfterInsert(java.lang.Object persistable,
                            int fieldNumber)

setPostStoreNewObjectId

void setPostStoreNewObjectId(java.lang.Object newId)

changeActivityState

void changeActivityState(ActivityState inserting)

getAssociatedValue

java.lang.Object getAssociatedValue(JavaTypeMapping mapping)

becomingDeleted

boolean becomingDeleted()

loadFieldsInFetchPlan

void loadFieldsInFetchPlan(FetchPlanState state)

loadFieldFromDatastore

void loadFieldFromDatastore(int fieldNumber)

getObjectId

java.lang.Object getObjectId()

getVersion

java.lang.Object getVersion()

unloadField

void unloadField(java.lang.String name)

replaceAllLoadedSCOFieldsWithWrappers

void replaceAllLoadedSCOFieldsWithWrappers()

replaceAllLoadedSCOFieldsWithValues

void replaceAllLoadedSCOFieldsWithValues()

getAllFieldsLoaded

boolean getAllFieldsLoaded()

replaceManagedPC

void replaceManagedPC(java.lang.Object pc2)

getLoadedFieldNames

java.lang.String[] getLoadedFieldNames()


Copyright © 2011. All Rights Reserved.