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>
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,
Session session)
Creates an operation object without a domain context
for a given connection.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertDomainContextMutable()
Asserts that the domain context is mutable.
|
P |
clone()
Clones the operation object.
|
PersistentOperation<T> |
clonePersistentOperation() |
DomainContext |
createValidContext() |
void |
determineContextId() |
DomainContext |
getBaseContext() |
PersistentOperationClassVariables<T,P> |
getClassVariables()
Gets the some attributes and variables common to all objects of the same class.
|
long |
getContextId() |
PersistentOperation<T> |
getDelegate() |
DomainContext |
getDomainContext()
Gets the database context.
|
DomainDelegate<T> |
getDomainDelegate() |
T |
getOperation() |
boolean |
isDomainContextImmutable()
Returns whether the domain context is immutable.
|
PersistentOperation<T> |
newInstance() |
T |
opn() |
void |
setDomainContext(DomainContext context)
Sets the database context.
|
void |
setDomainContextImmutable(boolean contextImmutable)
Sets the immutable flag of the domain context.
|
void |
setOperation(T po) |
void |
setSession(Session session)
Sets the logical db connection for this object.
|
getRemoteDelegate, getSession, getSessionHolder, isSessionImmutable, setSessionHolder, setSessionImmutableequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waiton, opnisSessionImmutable, setSessionImmutablegetSessionpublic AbstractPersistentOperation(T operation, DomainContext context)
operation - the operation object this is a delegate forcontext - the database contextpublic AbstractPersistentOperation(T operation, 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()
AbstractDbOperationclone 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()
AbstractDbOperation are kept in an
instance of DbOperationClassVariables.
In fact, PersistentOperationClassVariables is an extension of DbObjectClassVariables.
So this fullfills the requirements for AbstractDbObject
getClassVariables in class AbstractDbOperation<P extends AbstractPersistentOperation<T,P>>public void setSession(Session session)
Overridden to set the Db in DomainContext as well.
setSession in interface SessionDependablesetSession in class AbstractDbOperation<P extends AbstractPersistentOperation<T,P>>session - the sessionpublic 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 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()
Copyright © 2016 Krake Softwaretechnik. All rights reserved.