org.datanucleus.store.fieldmanager
Class AttachFieldManager

java.lang.Object
  extended by org.datanucleus.store.fieldmanager.AbstractFieldManager
      extended by org.datanucleus.store.fieldmanager.AttachFieldManager
All Implemented Interfaces:
FieldConsumer, FieldManager, FieldSupplier

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.
In the first case, the fields which are dirty 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

Version:
$Revision: 1.14 $

Field Summary
protected static Localiser LOCALISER
          Localiser for internationalisation.
 
Constructor Summary
AttachFieldManager(StateManager smAttached, boolean[] secondClassMutableFields, boolean[] dirtyFields, boolean persistent, boolean cascadeAttach, boolean copy)
          Constructor.
 
Method Summary
 void storeBooleanField(int fieldNumber, boolean value)
          Method to store a boolean field value in the object at the specified field position.
 void storeByteField(int fieldNumber, byte value)
          Method to store a byte field value in the object at the specified field position.
 void storeCharField(int fieldNumber, char value)
          Method to store a char field value in the object at the specified field position.
 void storeDoubleField(int fieldNumber, double value)
          Method to store a double field value in the object at the specified field position.
 void storeFloatField(int fieldNumber, float value)
          Method to store a float field value in the object at the specified field position.
 void storeIntField(int fieldNumber, int value)
          Method to store an int field value in the object at the specified field position.
 void storeLongField(int fieldNumber, long value)
          Method to store a long field value in the object at the specified field position.
 void storeObjectField(int fieldNumber, java.lang.Object value)
          Method to store an object field into the attached instance.
 void storeShortField(int fieldNumber, short value)
          Method to store a short field value in the object at the specified field position.
 void storeStringField(int fieldNumber, java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for internationalisation.

Constructor Detail

AttachFieldManager

public AttachFieldManager(StateManager smAttached,
                          boolean[] secondClassMutableFields,
                          boolean[] dirtyFields,
                          boolean persistent,
                          boolean cascadeAttach,
                          boolean copy)
Constructor.

Parameters:
smAttached - the attached instance
secondClassMutableFields - second class mutable field flags
dirtyFields - dirty field flags
persistent - whether the object is persistent
cascadeAttach - Whether to cascade any attach calls to related fields
Method Detail

storeObjectField

public void storeObjectField(int fieldNumber,
                             java.lang.Object value)
Method to store an object field into the attached instance.

Specified by:
storeObjectField in interface FieldConsumer
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: 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

storeStringField

public void storeStringField(int fieldNumber,
                             java.lang.String value)
Description copied from interface: FieldConsumer
Method to store a string field value in the object at the specified field position.

Specified by:
storeStringField in interface FieldConsumer
Overrides:
storeStringField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
value - value to store


Copyright © 2009. All Rights Reserved.