org.apache.openjpa.kernel
Class VersionAttachStrategy
java.lang.Object
org.apache.openjpa.kernel.TransferFieldManager
org.apache.openjpa.kernel.AttachStrategy
org.apache.openjpa.kernel.VersionAttachStrategy
- All Implemented Interfaces:
- FieldConsumer, FieldManager, FieldSupplier, DetachState
class VersionAttachStrategy
- extends AttachStrategy
- implements DetachState
Handles attaching instances using version and primary key fields.
- Author:
- Steve Kim
Method Summary |
Object |
attach(AttachManager manager,
Object toAttach,
ClassMetaData meta,
PersistenceCapable into,
OpenJPAStateManager owner,
ValueMetaData ownerMeta,
boolean explicit)
Attach. |
protected PersistenceCapable |
findFromDatabase(AttachManager manager,
Object pc)
Find a PersistenceCapable instance of an Object if it exists in the
database. |
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.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 |
VersionAttachStrategy
VersionAttachStrategy()
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 instancestoAttach
- detached instancemeta
- metadata for the instance being attachedinto
- instance we're attaching intoowner
- state manager for into
ownerMeta
- field we traversed to find toAttach
explicit
- whether to make new instances explicitly persistent
findFromDatabase
protected PersistenceCapable findFromDatabase(AttachManager manager,
Object pc)
- Find a PersistenceCapable instance of an Object if it exists in the
database. If the object is null or can't be found in the database.
- Parameters:
pc
- An object which will be attached into the current context. The
object may or may not correspond to a row in the database.
- Returns:
- If the object is null or can't be found in the database this
method returns null. Otherwise a PersistenceCapable representation of the
object is returned.
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.