Package org.tentackle.test.pdo.mock
Class MockPersistentOperation<T extends org.tentackle.pdo.Operation<T>>
- java.lang.Object
-
- org.tentackle.test.pdo.mock.MockPersistentOperation<T>
-
- Type Parameters:
T- the pdo type
- All Implemented Interfaces:
java.io.Serializable,org.tentackle.pdo.DomainContextDependable,org.tentackle.pdo.DomainContextProvider,org.tentackle.pdo.OperationHolder<T>,org.tentackle.pdo.PersistenceDelegate<T>,org.tentackle.pdo.PersistentOperation<T>,org.tentackle.pdo.ProxyDelegate<T>,org.tentackle.reflect.Interceptable,org.tentackle.session.SessionDependable,org.tentackle.session.SessionProvider
public class MockPersistentOperation<T extends org.tentackle.pdo.Operation<T>> extends java.lang.Object implements org.tentackle.pdo.PersistentOperation<T>A mocked persistence object.- Author:
- harald
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MockPersistentOperation()Creates an operation object without a database context.MockPersistentOperation(T operation)Creates an operation object without a database context.MockPersistentOperation(T operation, org.tentackle.pdo.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.tentackle.pdo.DomainContextcreateValidContext()voiddetermineContextId()org.tentackle.pdo.DomainContextgetBaseContext()longgetContextId()org.tentackle.pdo.DomainContextgetDomainContext()org.tentackle.pdo.DomainDelegate<T>getDomainDelegate()TgetOperation()org.tentackle.session.SessiongetSession()booleanisDomainContextImmutable()booleanisSessionImmutable()Tme()voidsetDomainContext(org.tentackle.pdo.DomainContext context)voidsetDomainContextImmutable(boolean contextImmutable)voidsetOperation(T operation)voidsetSession(org.tentackle.session.Session session)voidsetSessionImmutable(boolean sessionImmutable)
-
-
-
Constructor Detail
-
MockPersistentOperation
public MockPersistentOperation(T operation, org.tentackle.pdo.DomainContext context)
Creates an operation object.- Parameters:
operation- the operation object this is a delegate forcontext- the database context
-
MockPersistentOperation
public MockPersistentOperation(T operation, org.tentackle.session.Session session)
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
public MockPersistentOperation(T operation)
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 Detail
-
setSessionImmutable
public void setSessionImmutable(boolean sessionImmutable)
- Specified by:
setSessionImmutablein interfaceorg.tentackle.session.SessionDependable
-
isSessionImmutable
public boolean isSessionImmutable()
- Specified by:
isSessionImmutablein interfaceorg.tentackle.session.SessionDependable
-
setSession
public void setSession(org.tentackle.session.Session session)
- Specified by:
setSessionin interfaceorg.tentackle.session.SessionDependable
-
getSession
public org.tentackle.session.Session getSession()
- Specified by:
getSessionin interfaceorg.tentackle.session.SessionProvider
-
getDomainContext
public org.tentackle.pdo.DomainContext getDomainContext()
- Specified by:
getDomainContextin interfaceorg.tentackle.pdo.DomainContextProvider
-
setDomainContext
public void setDomainContext(org.tentackle.pdo.DomainContext context)
- Specified by:
setDomainContextin interfaceorg.tentackle.pdo.DomainContextDependable
-
determineContextId
public void determineContextId()
- Specified by:
determineContextIdin interfaceorg.tentackle.pdo.DomainContextDependable
-
getContextId
public long getContextId()
- Specified by:
getContextIdin interfaceorg.tentackle.pdo.DomainContextDependable
-
getBaseContext
public org.tentackle.pdo.DomainContext getBaseContext()
- Specified by:
getBaseContextin interfaceorg.tentackle.pdo.DomainContextDependable
-
createValidContext
public org.tentackle.pdo.DomainContext createValidContext()
- Specified by:
createValidContextin interfaceorg.tentackle.pdo.DomainContextDependable
-
isDomainContextImmutable
public boolean isDomainContextImmutable()
- Specified by:
isDomainContextImmutablein interfaceorg.tentackle.pdo.DomainContextDependable
-
setDomainContextImmutable
public void setDomainContextImmutable(boolean contextImmutable)
- Specified by:
setDomainContextImmutablein interfaceorg.tentackle.pdo.DomainContextDependable
-
getOperation
public T getOperation()
-
me
public T me()
-
setOperation
public void setOperation(T operation)
-
-