ResolverStrategy
public final class PersistanceCapableRelationResolver extends BaseRelationResolver
ResolverStrategy
for 1:1 relations._classMolder, _fieldMolder
Constructor | Description |
---|---|
PersistanceCapableRelationResolver(ClassMolder classMolder,
FieldMolder fieldMolder,
int fieldIndex) |
Creates an instance of this resolver class.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
create(TransactionContext tx,
java.lang.Object object) |
Create an object of the base class with specified identity into the
persistence storage.
|
void |
expireCache(TransactionContext tx,
java.lang.Object field) |
Inspect the fields stored in the object passed as an argument for
contained objects.
|
void |
load(TransactionContext tx,
OID oid,
ProposedEntity proposedObject,
AccessMode suggestedAccessMode) |
Load an object with specified identity from the persistent storage.
|
boolean |
markCreate(TransactionContext tx,
OID oid,
java.lang.Object object) |
Walk the object model and mark object that should be created.
|
void |
markDelete(TransactionContext tx,
java.lang.Object object,
java.lang.Object field) |
Prepare to delete an object with the specified identity.
|
java.lang.Object |
postCreate(TransactionContext tx,
OID oid,
java.lang.Object object,
java.lang.Object field,
Identity createdId) |
Called after successful creation of an object of the base class.
|
UpdateFlags |
preStore(TransactionContext tx,
OID oid,
java.lang.Object object,
int timeout,
java.lang.Object field) |
Check the object for modification.
|
UpdateAndRemovedFlags |
removeRelation(TransactionContext tx,
java.lang.Object object,
ClassMolder relatedMolder,
java.lang.Object relatedObject) |
Remove the reference of a related object from an object of
the base class.
|
void |
revertObject(TransactionContext tx,
OID oid,
java.lang.Object object,
java.lang.Object field) |
Revert the object back to the state of begining of the transaction
If the object is loaded, it will be revert as it was loaded.
|
java.lang.Object |
store(TransactionContext tx,
java.lang.Object object,
java.lang.Object field) |
Store a data object into the persistent storage of the base class of this
ClassMolder.
|
void |
update(TransactionContext tx,
OID oid,
java.lang.Object object,
AccessMode suggestedAccessMode,
java.lang.Object field) |
Update the object which loaded or created in the other transaction to
the persistent storage.
|
java.lang.Object |
updateCache(TransactionContext tx,
OID oid,
java.lang.Object object) |
Update the dirty checking cache.
|
boolean |
updateWhenNoTimestampSet(TransactionContext tx,
OID oid,
java.lang.Object object,
AccessMode suggestedAccessMode) |
Update the object which loaded or created in the other transaction to
the persistent storage.
|
isCascadingCreate, isCascadingDelete, isCascadingUpdate
public PersistanceCapableRelationResolver(ClassMolder classMolder, FieldMolder fieldMolder, int fieldIndex)
classMolder
- Enclosing class molder.fieldMolder
- Field MolderfieldIndex
- Field index within all fields of parent class molder.public java.lang.Object create(TransactionContext tx, java.lang.Object object)
ResolverStrategy
tx
- transaction in actionobject
- the object to be createdResolverStrategy.create(
org.castor.persist.TransactionContext, java.lang.Object)
public boolean markCreate(TransactionContext tx, OID oid, java.lang.Object object) throws PersistenceException
ResolverStrategy
tx
- transaction in actionoid
- the object identity of the object to be created.object
- the object to be createdPersistenceException
ResolverStrategy.markCreate(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object)
public UpdateFlags preStore(TransactionContext tx, OID oid, java.lang.Object object, int timeout, java.lang.Object field) throws PersistenceException
ResolverStrategy
tx
- transaction in actionoid
- the object identity of the objectobject
- the data object to be checkedtimeout
- timeout of updating the lock if neededfield
- The field value as returned by the SQLEnginePersistenceException
- If it is not possible to successfully complete this method.ResolverStrategy.preStore(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object, int, java.lang.Object)
public java.lang.Object store(TransactionContext tx, java.lang.Object object, java.lang.Object field)
ResolverStrategy
tx
- Transaction in actionobject
- the object to be storedfield
- The field value as returned by the SQLEngineResolverStrategy.store(
org.castor.persist.TransactionContext, java.lang.Object, java.lang.Object)
public void update(TransactionContext tx, OID oid, java.lang.Object object, AccessMode suggestedAccessMode, java.lang.Object field) throws PersistenceException
ResolverStrategy
tx
- Transaction in actionoid
- the object identity of the stored objectobject
- the object to be storedsuggestedAccessMode
- Suggested access modefield
- The field value as returned by the SQLEnginePersistenceException
- If it is not possible to successfully complete this method.ResolverStrategy.update(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object, org.exolab.castor.mapping.AccessMode, java.lang.Object)
public java.lang.Object updateCache(TransactionContext tx, OID oid, java.lang.Object object)
ResolverStrategy
tx
- - transaction in actionoid
- - object's identity of the target objectobject
- - the target objectResolverStrategy.updateCache(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object)
public void markDelete(TransactionContext tx, java.lang.Object object, java.lang.Object field) throws PersistenceException
ResolverStrategy
tx
- - transaction in actionobject
- - the target objectfield
- The field value as returned by the SQLEnginePersistenceException
- If it is not possible to successfully complete this method.ResolverStrategy.markDelete(
org.castor.persist.TransactionContext, java.lang.Object, java.lang.Object)
public void revertObject(TransactionContext tx, OID oid, java.lang.Object object, java.lang.Object field) throws PersistenceException
ResolverStrategy
tx
- - transaction in actionoid
- - the object identity of the target objectobject
- - the target objectfield
- The field value as returned by the SQLEnginePersistenceException
- If it is not possible to successfully complete this method.ResolverStrategy.revertObject(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object, java.lang.Object)
public void expireCache(TransactionContext tx, java.lang.Object field) throws PersistenceException
ResolverStrategy
tx
- The TransactionContext
field
- The field value as returned by the SQLEnginePersistenceException
- If it is not possible to successfully complete this method.ResolverStrategy.expireCache(
org.castor.persist.TransactionContext, java.lang.Object)
public void load(TransactionContext tx, OID oid, ProposedEntity proposedObject, AccessMode suggestedAccessMode) throws PersistenceException
ResolverStrategy
tx
- the TransactionContext in actionoid
- the object identity of the desired objectproposedObject
- Object holder storing information about assumed and actual object
instances.suggestedAccessMode
- the acessMode for the objectPersistenceException
- If it is not possible to successfully complete this method.ResolverStrategy.load(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
org.castor.persist.ProposedEntity, org.exolab.castor.mapping.AccessMode)
public java.lang.Object postCreate(TransactionContext tx, OID oid, java.lang.Object object, java.lang.Object field, Identity createdId)
ResolverStrategy
tx
- transaction in actionoid
- the object identity of the object to be created.object
- the object to be createdfield
- The field value as returned by the SQLEnginecreatedId
- ???ResolverStrategy.postCreate(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object, java.lang.Object, org.exolab.castor.persist.spi.Identity)
public UpdateAndRemovedFlags removeRelation(TransactionContext tx, java.lang.Object object, ClassMolder relatedMolder, java.lang.Object relatedObject)
ResolverStrategy
If the related object is PersistanceCapable, the field will be set null. If the related object is a Collection, then the related object will be removed from the Collection.
If any changed occured, transactionContext.markModified will be called, to indicate the object is modified.
It method will iterate thur all of the object's field and try to remove all the occurrence.
tx
- the TransactionContext of the transaction in actionobject
- the target object of the base type of this ClassMolderrelatedMolder
- the ClassMolder of the related object to be
removed from the objectrelatedObject
- the object to be removedResolverStrategy.removeRelation(
org.castor.persist.TransactionContext, java.lang.Object,
org.exolab.castor.persist.ClassMolder, java.lang.Object)
public boolean updateWhenNoTimestampSet(TransactionContext tx, OID oid, java.lang.Object object, AccessMode suggestedAccessMode) throws PersistenceException
ResolverStrategy
tx
- Transaction in actionoid
- the object identity of the stored objectobject
- the object to be storedsuggestedAccessMode
- Suggested access modePersistenceException
- If it is not possible to successfully complete this method.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com