Class PersistFieldManager
- java.lang.Object
-
- org.datanucleus.store.fieldmanager.AbstractFieldManager
-
- org.datanucleus.store.fieldmanager.PersistFieldManager
-
- All Implemented Interfaces:
FieldManager
public class PersistFieldManager extends AbstractFieldManager
Field manager that persists all unpersisted PC objects referenced from the source object. If any collection/map fields are not currently using SCO wrappers they will be converted to do so. Effectively provides "persistence-by-reachability" (at insert/update).
-
-
Constructor Summary
Constructors Constructor Description PersistFieldManager(DNStateManager sm, boolean replaceSCOsWithWrappers)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectprocessPersistable(Object pc, int ownerFieldNum, PersistableObjectType objectType)Utility method to process the passed persistable object.voidstoreBooleanField(int fieldNumber, boolean value)Method to store a boolean field value in the object at the specified field position.voidstoreByteField(int fieldNumber, byte value)Method to store a byte field value in the object at the specified field position.voidstoreCharField(int fieldNumber, char value)Method to store a char field value in the object at the specified field position.voidstoreDoubleField(int fieldNumber, double value)Method to store a double field value in the object at the specified field position.voidstoreFloatField(int fieldNumber, float value)Method to store a float field value in the object at the specified field position.voidstoreIntField(int fieldNumber, int value)Method to store an int field value in the object at the specified field position.voidstoreLongField(int fieldNumber, long value)Method to store a long field value in the object at the specified field position.voidstoreObjectField(int fieldNumber, Object value)Method to store an object field.voidstoreShortField(int fieldNumber, short value)Method to store a short field value in the object at the specified field position.voidstoreStringField(int fieldNumber, String value)Method to store a string field value in the object at the specified field position.-
Methods inherited from class org.datanucleus.store.fieldmanager.AbstractFieldManager
fetchBooleanField, fetchByteField, fetchCharField, fetchDoubleField, fetchFloatField, fetchIntField, fetchLongField, fetchObjectField, fetchShortField, fetchStringField
-
-
-
-
Constructor Detail
-
PersistFieldManager
public PersistFieldManager(DNStateManager sm, boolean replaceSCOsWithWrappers)
Constructor.- Parameters:
sm- StateManager for the object.replaceSCOsWithWrappers- Whether to swap any SCO field objects for SCO wrappers
-
-
Method Detail
-
processPersistable
protected Object processPersistable(Object pc, int ownerFieldNum, PersistableObjectType objectType)
Utility method to process the passed persistable object.- Parameters:
pc- The PC objectownerFieldNum- Field number of owner where this is embeddedobjectType- Type of object- Returns:
- The processed persistable object
-
storeObjectField
public void storeObjectField(int fieldNumber, Object value)Method to store an object field.- Specified by:
storeObjectFieldin interfaceFieldManager- Overrides:
storeObjectFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the field (absolute)value- Value of the field
-
storeBooleanField
public void storeBooleanField(int fieldNumber, boolean value)Description copied from interface:FieldManagerMethod to store a boolean field value in the object at the specified field position.- Specified by:
storeBooleanFieldin interfaceFieldManager- Overrides:
storeBooleanFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeByteField
public void storeByteField(int fieldNumber, byte value)Description copied from interface:FieldManagerMethod to store a byte field value in the object at the specified field position.- Specified by:
storeByteFieldin interfaceFieldManager- Overrides:
storeByteFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeCharField
public void storeCharField(int fieldNumber, char value)Description copied from interface:FieldManagerMethod to store a char field value in the object at the specified field position.- Specified by:
storeCharFieldin interfaceFieldManager- Overrides:
storeCharFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeDoubleField
public void storeDoubleField(int fieldNumber, double value)Description copied from interface:FieldManagerMethod to store a double field value in the object at the specified field position.- Specified by:
storeDoubleFieldin interfaceFieldManager- Overrides:
storeDoubleFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeFloatField
public void storeFloatField(int fieldNumber, float value)Description copied from interface:FieldManagerMethod to store a float field value in the object at the specified field position.- Specified by:
storeFloatFieldin interfaceFieldManager- Overrides:
storeFloatFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeIntField
public void storeIntField(int fieldNumber, int value)Description copied from interface:FieldManagerMethod to store an int field value in the object at the specified field position.- Specified by:
storeIntFieldin interfaceFieldManager- Overrides:
storeIntFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeLongField
public void storeLongField(int fieldNumber, long value)Description copied from interface:FieldManagerMethod to store a long field value in the object at the specified field position.- Specified by:
storeLongFieldin interfaceFieldManager- Overrides:
storeLongFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeShortField
public void storeShortField(int fieldNumber, short value)Description copied from interface:FieldManagerMethod to store a short field value in the object at the specified field position.- Specified by:
storeShortFieldin interfaceFieldManager- Overrides:
storeShortFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
storeStringField
public void storeStringField(int fieldNumber, String value)Description copied from interface:FieldManagerMethod to store a string field value in the object at the specified field position.- Specified by:
storeStringFieldin interfaceFieldManager- Overrides:
storeStringFieldin classAbstractFieldManager- Parameters:
fieldNumber- Number of the fieldvalue- value to store
-
-