org.jpox.state
Class AttachFieldManager

java.lang.Object
  extended byorg.jpox.store.fieldmanager.AbstractFieldManager
      extended byorg.jpox.state.AttachFieldManager
All Implemented Interfaces:
FieldManager, javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer, javax.jdo.spi.PersistenceCapable.ObjectIdFieldManager, javax.jdo.spi.PersistenceCapable.ObjectIdFieldSupplier

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.

Version:
$Revision: 1.20 $

Field Summary
protected static Localiser LOCALISER
          Localiser for internationalisation.
 
Constructor Summary
AttachFieldManager(StateManager smAttached, boolean[] secondClassMutableFields, boolean[] dirtyFields, boolean persistent, boolean cascadeAttach)
          Constructor.
 
Method Summary
 void storeBooleanField(int fieldNumber, boolean value)
           
 void storeByteField(int fieldNumber, byte value)
           
 void storeCharField(int fieldNumber, char value)
           
 void storeDoubleField(int fieldNumber, double value)
           
 void storeFloatField(int fieldNumber, float value)
           
 void storeIntField(int fieldNumber, int value)
           
 void storeLongField(int fieldNumber, long value)
           
 void storeObjectField(int fieldNumber, java.lang.Object value)
          Method to store an object field into the attached instance
 void storeShortField(int fieldNumber, short value)
           
 void storeStringField(int fieldNumber, java.lang.String value)
           
 
Methods inherited from class org.jpox.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)
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 javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
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)
Specified by:
storeBooleanField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeBooleanField in class AbstractFieldManager

storeByteField

public void storeByteField(int fieldNumber,
                           byte value)
Specified by:
storeByteField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeByteField in class AbstractFieldManager

storeCharField

public void storeCharField(int fieldNumber,
                           char value)
Specified by:
storeCharField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeCharField in class AbstractFieldManager

storeDoubleField

public void storeDoubleField(int fieldNumber,
                             double value)
Specified by:
storeDoubleField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeDoubleField in class AbstractFieldManager

storeFloatField

public void storeFloatField(int fieldNumber,
                            float value)
Specified by:
storeFloatField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeFloatField in class AbstractFieldManager

storeIntField

public void storeIntField(int fieldNumber,
                          int value)
Specified by:
storeIntField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeIntField in class AbstractFieldManager

storeLongField

public void storeLongField(int fieldNumber,
                           long value)
Specified by:
storeLongField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeLongField in class AbstractFieldManager

storeShortField

public void storeShortField(int fieldNumber,
                            short value)
Specified by:
storeShortField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeShortField in class AbstractFieldManager

storeStringField

public void storeStringField(int fieldNumber,
                             java.lang.String value)
Specified by:
storeStringField in interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
Overrides:
storeStringField in class AbstractFieldManager


Copyright © -2007 . All Rights Reserved.