org.apache.openjpa.kernel
Class DetachedStateAttachStrategy

java.lang.Object
  extended by org.apache.openjpa.kernel.TransferFieldManager
      extended by org.apache.openjpa.kernel.AttachStrategy
          extended by org.apache.openjpa.kernel.DetachedStateAttachStrategy
All Implemented Interfaces:
FieldConsumer, FieldManager, FieldSupplier

 class DetachedStateAttachStrategy
extends AttachStrategy

Handles attaching instances with detached state.

Author:
Marc Prud'hommeaux

Field Summary
 
Fields inherited from class org.apache.openjpa.kernel.TransferFieldManager
dblval, field, longval, objval
 
Constructor Summary
DetachedStateAttachStrategy()
           
 
Method Summary
 Object attach(AttachManager manager, Object toAttach, ClassMetaData meta, PersistenceCapable into, OpenJPAStateManager owner, ValueMetaData ownerMeta, boolean explicit)
          Attach.
protected  Object getDetachedObjectId(AttachManager manager, Object toAttach)
          Return the identity of the given detached instance.
protected  void provideField(Object toAttach, StateManagerImpl sm, int field)
          Provide the given field into this field manager.
 
Methods inherited from class org.apache.openjpa.kernel.AttachStrategy
attachCollection, attachField, attachMap, getReference, persist
 
Methods inherited from class org.apache.openjpa.kernel.TransferFieldManager
clear, fetchBooleanField, fetchByteField, fetchCharField, fetchDoubleField, fetchFloatField, fetchIntField, fetchLongField, fetchObjectField, fetchShortField, fetchStringField, storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeObjectField, storeShortField, storeStringField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetachedStateAttachStrategy

DetachedStateAttachStrategy()
Method Detail

getDetachedObjectId

protected Object getDetachedObjectId(AttachManager manager,
                                     Object toAttach)
Description copied from class: AttachStrategy
Return the identity of the given detached instance.

Specified by:
getDetachedObjectId in class AttachStrategy

provideField

protected void provideField(Object toAttach,
                            StateManagerImpl sm,
                            int field)
Description copied from class: AttachStrategy
Provide the given field into this field manager.

Specified by:
provideField in class AttachStrategy

attach

public Object attach(AttachManager manager,
                     Object toAttach,
                     ClassMetaData meta,
                     PersistenceCapable into,
                     OpenJPAStateManager owner,
                     ValueMetaData ownerMeta,
                     boolean explicit)
Description copied from class: AttachStrategy
Attach.

Specified by:
attach in class AttachStrategy
Parameters:
manager - manager holding cache of attached instances
toAttach - detached instance
meta - metadata for the instance being attached
into - instance we're attaching into
owner - state manager for into
ownerMeta - field we traversed to find toAttach
explicit - whether to make new instances explicitly persistent


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.