public final class OneToManyRelationResolver extends ManyRelationResolver
_classMolder, _fieldMolder
Constructor and Description |
---|
OneToManyRelationResolver(ClassMolder classMolder,
FieldMolder fieldMolder,
int fieldIndex)
Creates an instance of OneToMany.
|
Modifier and Type | Method and Description |
---|---|
boolean |
markCreate(TransactionContext tx,
OID oid,
Object object)
Walk the object model and mark object that should be created.
|
void |
markDelete(TransactionContext tx,
Object object,
Object field)
Prepare to delete an object with the specified identity.
|
Object |
postCreate(TransactionContext tx,
OID oid,
Object object,
Object field,
Identity createdId)
Called after successful creation of an object of the base class.
|
UpdateFlags |
preStore(TransactionContext tx,
OID oid,
Object object,
int timeout,
Object field)
Check the object for modification.
|
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.
|
boolean |
updateWhenNoTimestampSet(TransactionContext tx,
OID oid,
Object object,
AccessMode suggestedAccessMode)
Update the object which loaded or created in the other transaction to
the persistent storage.
|
create, expireCache, load, removeRelation, revertObject, store, updateCache
isCascadingCreate, isCascadingDelete, isCascadingUpdate
public OneToManyRelationResolver(ClassMolder classMolder, FieldMolder fieldMolder, int fieldIndex)
classMolder
- fieldMolder
- fieldIndex
- Field index within all fields of parent class molder.public boolean markCreate(TransactionContext tx, OID oid, Object object) throws PersistenceException
ResolverStrategy
markCreate
in interface ResolverStrategy
markCreate
in class ManyRelationResolver
tx
- transaction in actionoid
- the object identity of the object to be created.object
- the object to be createdPersistenceException
#markCreate(org.castor.persist.TransactionContext,
org.exolab.castor.persist.OID, java.lang.Object)
public void markDelete(TransactionContext tx, Object object, Object field) throws PersistenceException
ResolverStrategy
markDelete
in interface ResolverStrategy
markDelete
in class ManyRelationResolver
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.#markDelete(org.castor.persist.TransactionContext, java.lang.Object,
java.lang.Object)
public UpdateFlags preStore(TransactionContext tx, OID oid, Object object, int timeout, Object field) throws PersistenceException
ResolverStrategy
preStore
in interface ResolverStrategy
preStore
in class ManyRelationResolver
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.#preStore(org.castor.persist.TransactionContext,
org.exolab.castor.persist.OID, java.lang.Object, int,
java.lang.Object)
public void update(TransactionContext tx, OID oid, Object object, AccessMode suggestedAccessMode, Object field) throws PersistenceException
ResolverStrategy
update
in interface ResolverStrategy
update
in class ManyRelationResolver
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.#update(org.castor.persist.TransactionContext,
org.exolab.castor.persist.OID, java.lang.Object,
org.exolab.castor.mapping.AccessMode, java.lang.Object)
public Object postCreate(TransactionContext tx, OID oid, Object object, Object field, Identity createdId)
ResolverStrategy
postCreate
in interface ResolverStrategy
postCreate
in class ManyRelationResolver
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
- ???#postCreate(org.castor.persist.TransactionContext,
org.exolab.castor.persist.OID, org.exolab.castor.persist.DepositBox,
java.lang.Object, org.exolab.castor.mapping.AccessMode,
java.lang.Object)
public boolean updateWhenNoTimestampSet(TransactionContext tx, OID oid, 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.Copyright © 2016. All rights reserved.