T - the PO class (interface)P - the operation implementation classpublic abstract class AbstractPersistentOperation<T extends Operation<T>,P extends AbstractPersistentOperation<T,P>> extends AbstractDbOperation<P> implements PersistenceDelegate<T>, PersistentOperation<T>, org.tentackle.reflect.EffectiveClassProvider<T>
AbstractPersistentOperation provides methods that are not part of PersistentOperations
and is associated to a DomainContext. Complex transactions are usually
AbstractPersistentOperations. AbstractPersistentOperations are remote capabable.| Constructor and Description |
|---|
AbstractPersistentOperation()
Creates an operation object without a database context.
|
AbstractPersistentOperation(T operation)
Creates an operation object without a database context.
|
AbstractPersistentOperation(T operation,
DomainContext context)
Creates an operation object.
|
AbstractPersistentOperation(T operation,
org.tentackle.session.Session session)
Creates an operation object without a domain context
for a given connection.
|
getRemoteDelegate, getSession, getSessionHolder, isSessionImmutable, setSessionHolder, setSessionImmutableequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitopon, oppublic AbstractPersistentOperation(T operation, DomainContext context)
operation - the operation object this is a delegate forcontext - the database contextpublic AbstractPersistentOperation(T operation, org.tentackle.session.Session session)
Note: the application must set the context.
operation - the operation object this is a delegate forsession - the session (must be an instance of Session).public AbstractPersistentOperation(T operation)
Note: the application must set the context.
operation - the persistent operation object this is a delegate forpublic AbstractPersistentOperation()
public DomainDelegate<T> getDomainDelegate()
getDomainDelegate in interface PersistenceDelegate<T extends Operation<T>>public P clone()
clone in class AbstractDbOperation<P extends AbstractPersistentOperation<T,P>>public PersistentOperation<T> clonePersistentOperation()
clonePersistentOperation in interface PersistentOperation<T extends Operation<T>>public PersistentOperationClassVariables<T,P> getClassVariables()
In fact, PersistentOperationClassVariables is an extension of
DbOperationClassVariables.
So this fullfills the requirements for AbstractDbObject
getClassVariables in class AbstractDbOperation<P extends AbstractPersistentOperation<T,P>>public void setSession(org.tentackle.session.Session session)
Overridden to set the Db in DomainContext as well.
setSession in interface org.tentackle.session.SessionDependablesetSession in class AbstractDbOperation<P extends AbstractPersistentOperation<T,P>>public void setDomainContext(DomainContext context)
setDomainContext in interface DomainContextDependablecontext - the domain contextpublic DomainContext getDomainContext()
getDomainContext in interface DomainContextProviderpublic PersistentOperation<T> getDelegate()
getDelegate in interface PersistentOperation<T extends Operation<T>>public PersistentOperation<T> newInstance()
newInstance in interface PersistentOperation<T extends Operation<T>>public T operation()
operation in interface PersistentOperation<T extends Operation<T>>public T getOperation()
getOperation in interface OperationHolder<T extends Operation<T>>public void setOperation(T po)
setOperation in interface OperationHolder<T extends Operation<T>>public void determineContextId()
The default implementation does nothing (object living in a context not depending on another object).
determineContextId in interface DomainContextDependablepublic long getContextId()
The default implementation returns -1.
getContextId in interface DomainContextDependablepublic DomainContext getBaseContext()
The default implementation returns the PDO's DomainContext.
getBaseContext in interface DomainContextDependablepublic DomainContext createValidContext()
The default implementation just returns a new DomainContext.
createValidContext in interface DomainContextDependablepublic boolean isDomainContextImmutable()
isDomainContextImmutable in interface DomainContextDependablepublic void setDomainContextImmutable(boolean contextImmutable)
setDomainContextImmutable in interface DomainContextDependablecontextImmutable - true if context cannot be changedprotected void assertDomainContextMutable()
Tentackle - distributed, domain- and model-driven