Class PersistFieldManager

  • All Implemented Interfaces:
    FieldConsumer, FieldManager, FieldSupplier

    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 Detail

      • PersistFieldManager

        public PersistFieldManager​(ObjectProvider op,
                                   boolean replaceSCOsWithWrappers)
        Constructor.
        Parameters:
        op - The ObjectProvider for the object.
        replaceSCOsWithWrappers - Whether to swap any SCO field objects for SCO wrappers
    • Method Detail

      • processPersistable

        protected Object processPersistable​(Object pc,
                                            int ownerFieldNum,
                                            int objectType)
        Utility method to process the passed persistable object.
        Parameters:
        pc - The PC object
        ownerFieldNum - Field number of owner where this is embedded
        objectType - Type of object (see org.datanucleus.ObjectProvider)
        Returns:
        The processed persistable object
      • storeBooleanField

        public void storeBooleanField​(int fieldNumber,
                                      boolean value)
        Description copied from interface: FieldConsumer
        Method to store a boolean field value in the object at the specified field position.
        Specified by:
        storeBooleanField in interface FieldConsumer
        Overrides:
        storeBooleanField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeByteField

        public void storeByteField​(int fieldNumber,
                                   byte value)
        Description copied from interface: FieldConsumer
        Method to store a byte field value in the object at the specified field position.
        Specified by:
        storeByteField in interface FieldConsumer
        Overrides:
        storeByteField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeCharField

        public void storeCharField​(int fieldNumber,
                                   char value)
        Description copied from interface: FieldConsumer
        Method to store a char field value in the object at the specified field position.
        Specified by:
        storeCharField in interface FieldConsumer
        Overrides:
        storeCharField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeDoubleField

        public void storeDoubleField​(int fieldNumber,
                                     double value)
        Description copied from interface: FieldConsumer
        Method to store a double field value in the object at the specified field position.
        Specified by:
        storeDoubleField in interface FieldConsumer
        Overrides:
        storeDoubleField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeFloatField

        public void storeFloatField​(int fieldNumber,
                                    float value)
        Description copied from interface: FieldConsumer
        Method to store a float field value in the object at the specified field position.
        Specified by:
        storeFloatField in interface FieldConsumer
        Overrides:
        storeFloatField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeIntField

        public void storeIntField​(int fieldNumber,
                                  int value)
        Description copied from interface: FieldConsumer
        Method to store an int field value in the object at the specified field position.
        Specified by:
        storeIntField in interface FieldConsumer
        Overrides:
        storeIntField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeLongField

        public void storeLongField​(int fieldNumber,
                                   long value)
        Description copied from interface: FieldConsumer
        Method to store a long field value in the object at the specified field position.
        Specified by:
        storeLongField in interface FieldConsumer
        Overrides:
        storeLongField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store
      • storeShortField

        public void storeShortField​(int fieldNumber,
                                    short value)
        Description copied from interface: FieldConsumer
        Method to store a short field value in the object at the specified field position.
        Specified by:
        storeShortField in interface FieldConsumer
        Overrides:
        storeShortField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store