|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.persist.resolver.ManyRelationResolver
public abstract class ManyRelationResolver
Implementation of ResolverStrategy for many relations.
This class carries behaviour common to 1:M and M:N relations.
| Field Summary | |
|---|---|
protected ClassMolder |
_classMolder
Associated ClassMolder. |
protected FieldMolder |
_fieldMolder
Associated FieldMolder. |
| Constructor Summary | |
|---|---|
ManyRelationResolver(ClassMolder classMolder,
FieldMolder fieldMolder,
int fieldIndex,
boolean debug)
Creates an instance of ManyRelationResolver. |
|
| Method Summary | |
|---|---|
Object |
create(TransactionContext tx,
Object object)
Create an object of the base class with specified identity into the persistence storage. |
void |
expireCache(TransactionContext tx,
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. |
abstract boolean |
markCreate(TransactionContext tx,
OID oid,
Object object)
Walk the object model and mark object that should be created. |
abstract void |
markDelete(TransactionContext tx,
Object object,
Object field)
Prepare to delete an object with the specified identity. |
abstract Object |
postCreate(TransactionContext tx,
OID oid,
Object object,
Object field,
Identity createdId)
Called after successful creation of an object of the base class. |
abstract UpdateFlags |
preStore(TransactionContext tx,
OID oid,
Object object,
int timeout,
Object field)
Check the object for modification. |
UpdateAndRemovedFlags |
removeRelation(TransactionContext tx,
Object object,
ClassMolder relatedMolder,
Object relatedObject)
Remove the reference of a related object from an object of the base class. |
void |
revertObject(TransactionContext tx,
OID oid,
Object object,
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. |
Object |
store(TransactionContext tx,
Object object,
Object field)
Store a data object into the persistent storage of the base class of this ClassMolder. |
abstract void |
update(TransactionContext tx,
OID oid,
Object object,
AccessMode suggestedAccessMode,
Object field)
Update the object which loaded or created in the other transaction to the persistent storage. |
Object |
updateCache(TransactionContext tx,
OID oid,
Object object)
Update the dirty checking cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.castor.persist.resolver.ResolverStrategy |
|---|
updateWhenNoTimestampSet |
| Field Detail |
|---|
protected ClassMolder _classMolder
ClassMolder.
protected FieldMolder _fieldMolder
FieldMolder.
| Constructor Detail |
|---|
public ManyRelationResolver(ClassMolder classMolder,
FieldMolder fieldMolder,
int fieldIndex,
boolean debug)
classMolder - Associated ClassMolderfieldMolder - Associated FieldMolderfieldIndex - Field index within all fields of parent class molder.debug - ???| Method Detail |
|---|
public final Object create(TransactionContext tx,
Object object)
ResolverStrategy
create in interface ResolverStrategytx - transaction in actionobject - the object to be created
#create(org.castor.persist.TransactionContext,
java.lang.Object)
public abstract boolean markCreate(TransactionContext tx,
OID oid,
Object object)
throws PersistenceException
ResolverStrategy
markCreate in interface ResolverStrategytx - transaction in actionoid - the object identity of the object to be created.object - the object to be created
PersistenceExceptionResolverStrategy.markCreate(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object)
public abstract UpdateFlags preStore(TransactionContext tx,
OID oid,
Object object,
int timeout,
Object field)
throws PersistenceException
ResolverStrategy
preStore in interface ResolverStrategytx - 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 SQLEngine
PersistenceException - 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 final Object store(TransactionContext tx,
Object object,
Object field)
ResolverStrategy
store in interface ResolverStrategytx - 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 abstract void update(TransactionContext tx,
OID oid,
Object object,
AccessMode suggestedAccessMode,
Object field)
throws PersistenceException
ResolverStrategy
update in interface ResolverStrategytx - 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 SQLEngine
PersistenceException - 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 final Object updateCache(TransactionContext tx,
OID oid,
Object object)
ResolverStrategy
updateCache in interface ResolverStrategytx - - transaction in actionoid - - object's identity of the target objectobject - - the target object
ResolverStrategy.updateCache(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object)
public abstract void markDelete(TransactionContext tx,
Object object,
Object field)
throws PersistenceException
ResolverStrategy
markDelete in interface ResolverStrategytx - - transaction in actionobject - - the target objectfield - The field value as returned by the SQLEngine
PersistenceException - If it is not possible to successfully complete this method.ResolverStrategy.markDelete(
org.castor.persist.TransactionContext, java.lang.Object, java.lang.Object)
public final void revertObject(TransactionContext tx,
OID oid,
Object object,
Object field)
throws PersistenceException
ResolverStrategy
revertObject in interface ResolverStrategytx - - transaction in actionoid - - the object identity of the target objectobject - - the target objectfield - The field value as returned by the SQLEngine
PersistenceException - 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 final void expireCache(TransactionContext tx,
Object field)
throws PersistenceException
ResolverStrategy
expireCache in interface ResolverStrategytx - The TransactionContextfield - The field value as returned by the SQLEngine
PersistenceException - If it is not possible to successfully complete this method.ResolverStrategy.expireCache(
org.castor.persist.TransactionContext, java.lang.Object)
public final void load(TransactionContext tx,
OID oid,
ProposedEntity proposedObject,
AccessMode suggestedAccessMode)
throws PersistenceException
ResolverStrategy
load in interface ResolverStrategytx - 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 object
PersistenceException - 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 abstract Object postCreate(TransactionContext tx,
OID oid,
Object object,
Object field,
Identity createdId)
throws PersistenceException
ResolverStrategy
postCreate in interface ResolverStrategytx - 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 - ???
PersistenceExceptionResolverStrategy.postCreate(
org.castor.persist.TransactionContext, org.exolab.castor.persist.OID,
java.lang.Object, java.lang.Object, org.exolab.castor.persist.spi.Identity)
public final UpdateAndRemovedFlags removeRelation(TransactionContext tx,
Object object,
ClassMolder relatedMolder,
Object relatedObject)
ResolverStrategyIf 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.
removeRelation in interface ResolverStrategytx - 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 removed
ResolverStrategy.removeRelation(
org.castor.persist.TransactionContext, java.lang.Object,
org.exolab.castor.persist.ClassMolder, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||