Package org.tentackle.pdo.mock
Class MockPersistentOperation<T extends Operation<T>>
java.lang.Object
org.tentackle.pdo.mock.MockPersistentOperation<T>
- Type Parameters:
T
- the pdo type
- All Implemented Interfaces:
Serializable
,DomainContextDependable
,DomainContextProvider
,OperationMethodCacheProvider<T>
,OperationProvider<T>
,PersistenceDelegate<T>
,PersistentOperation<T>
,ProxyDelegate<T>
,org.tentackle.reflect.Interceptable
,org.tentackle.session.SessionDependable
,org.tentackle.session.SessionProvider
public class MockPersistentOperation<T extends Operation<T>>
extends Object
implements PersistentOperation<T>, OperationMethodCacheProvider<T>
A mocked persistence object.
- Author:
- harald
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates an operation object without a database context.MockPersistentOperation
(T operation) Creates an operation object without a database context.MockPersistentOperation
(T operation, DomainContext context) Creates an operation object.MockPersistentOperation
(T operation, org.tentackle.session.Session session) Creates an operation object without a domain context for a given connection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
long
org.tentackle.session.Session
boolean
boolean
me()
void
setDomainContext
(DomainContext context) void
setDomainContextImmutable
(boolean contextImmutable) void
setOperation
(T operation) Sets the operation.void
setSession
(org.tentackle.session.Session session) void
setSessionImmutable
(boolean sessionImmutable) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tentackle.pdo.DomainContextProvider
isWithinContext, isWithinContext, on, on, op, op
Methods inherited from interface org.tentackle.pdo.OperationProvider
op, op
-
Constructor Details
-
MockPersistentOperation
Creates an operation object.- Parameters:
operation
- the operation object this is a delegate forcontext
- the database context
-
MockPersistentOperation
Creates an operation object without a domain context for a given connection.Note: the application must set the context.
- Parameters:
operation
- the operation object this is a delegate forsession
- the session (must be an instance ofSession
).
-
MockPersistentOperation
Creates an operation object without a database context.Note: the application must set the context.
- Parameters:
operation
- the operation object this is a delegate for
-
MockPersistentOperation
public MockPersistentOperation()Creates an operation object without a database context.
-
-
Method Details
-
getOperationMethodCache
- Specified by:
getOperationMethodCache
in interfaceOperationMethodCacheProvider<T extends Operation<T>>
-
setSessionImmutable
public void setSessionImmutable(boolean sessionImmutable) - Specified by:
setSessionImmutable
in interfaceorg.tentackle.session.SessionDependable
-
isSessionImmutable
public boolean isSessionImmutable()- Specified by:
isSessionImmutable
in interfaceorg.tentackle.session.SessionDependable
-
setSession
public void setSession(org.tentackle.session.Session session) - Specified by:
setSession
in interfaceorg.tentackle.session.SessionDependable
-
getSession
public org.tentackle.session.Session getSession()- Specified by:
getSession
in interfaceorg.tentackle.session.SessionProvider
-
getDomainContext
- Specified by:
getDomainContext
in interfaceDomainContextProvider
-
setDomainContext
- Specified by:
setDomainContext
in interfaceDomainContextDependable
-
determineContextId
public void determineContextId()- Specified by:
determineContextId
in interfaceDomainContextDependable
-
getContextId
public long getContextId()- Specified by:
getContextId
in interfaceDomainContextDependable
-
getBaseContext
- Specified by:
getBaseContext
in interfaceDomainContextDependable
-
createValidContext
- Specified by:
createValidContext
in interfaceDomainContextDependable
-
isDomainContextImmutable
public boolean isDomainContextImmutable()- Specified by:
isDomainContextImmutable
in interfaceDomainContextDependable
-
setDomainContextImmutable
public void setDomainContextImmutable(boolean contextImmutable) - Specified by:
setDomainContextImmutable
in interfaceDomainContextDependable
-
getOperation
- Specified by:
getOperation
in interfaceOperationProvider<T extends Operation<T>>
-
me
- Specified by:
me
in interfaceProxyDelegate<T extends Operation<T>>
-
setOperation
Sets the operation.- Parameters:
operation
- the operation
-
getDomainDelegate
- Specified by:
getDomainDelegate
in interfacePersistenceDelegate<T extends Operation<T>>
-