Class AttachFieldManager

  • All Implemented Interfaces:
    FieldManager

    public class AttachFieldManager
    extends AbstractFieldManager
    Utility class to handle the attach of fields. The attachment process has 2 distinct cases to cater for.
    1. The object was detached, has been updated, and needs reattaching.
    2. The object was detached from a different datastore, and is being attached here and we want to do a pass through the object to update the fields in the object before it is persisted
    In the first case, the fields which are specified have their values (and dirty flags) updated. In the second case, all fields have their fields (and dirty flags) updated. In addition this field manager allows attaching a copy, or attaching in-situ.
    • Constructor Detail

      • AttachFieldManager

        public AttachFieldManager​(DNStateManager attachedSM,
                                  boolean[] secondClassMutableFields,
                                  boolean[] dirtyFields,
                                  boolean persistent,
                                  boolean cascadeAttach,
                                  boolean copy)
        Constructor.
        Parameters:
        attachedSM - StateManager for the attached instance
        secondClassMutableFields - second class mutable field flags
        dirtyFields - Flags for whether the field(s) are dirty
        persistent - whether the object being "attached" is persistent (yet)
        cascadeAttach - Whether to cascade any attach calls to related fields
        copy - Whether to attach copy
    • Method Detail

      • storeObjectField

        public void storeObjectField​(int fieldNumber,
                                     Object value)
        Method to store an object field into the attached instance.
        Specified by:
        storeObjectField in interface FieldManager
        Overrides:
        storeObjectField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field to store
        value - the value in the detached instance
      • storeBooleanField

        public void storeBooleanField​(int fieldNumber,
                                      boolean value)
        Description copied from interface: FieldManager
        Method to store a boolean field value in the object at the specified field position.
        Specified by:
        storeBooleanField in interface FieldManager
        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: FieldManager
        Method to store a byte field value in the object at the specified field position.
        Specified by:
        storeByteField in interface FieldManager
        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: FieldManager
        Method to store a char field value in the object at the specified field position.
        Specified by:
        storeCharField in interface FieldManager
        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: FieldManager
        Method to store a double field value in the object at the specified field position.
        Specified by:
        storeDoubleField in interface FieldManager
        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: FieldManager
        Method to store a float field value in the object at the specified field position.
        Specified by:
        storeFloatField in interface FieldManager
        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: FieldManager
        Method to store an int field value in the object at the specified field position.
        Specified by:
        storeIntField in interface FieldManager
        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: FieldManager
        Method to store a long field value in the object at the specified field position.
        Specified by:
        storeLongField in interface FieldManager
        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: FieldManager
        Method to store a short field value in the object at the specified field position.
        Specified by:
        storeShortField in interface FieldManager
        Overrides:
        storeShortField in class AbstractFieldManager
        Parameters:
        fieldNumber - Number of the field
        value - value to store