Module org.tentackle.database
Package org.tentackle.dbms
Class AbstractDbOperation<P extends AbstractDbOperation<P>>
java.lang.Object
org.tentackle.dbms.AbstractDbOperation<P>
- Type Parameters:
P- the operation class type
- All Implemented Interfaces:
Serializable,SessionDependable,SessionProvider
- Direct Known Subclasses:
DbPreferencesOperation
public abstract class AbstractDbOperation<P extends AbstractDbOperation<P>>
extends Object
implements SessionDependable, Serializable
A
AbstractDbOperation provides methods that are not part of AbstractDbObjects
and is associated to a Db-session. Complex transactions are usually
AbstractDbOperations. AbstractDbOperations are remoting capable.- Author:
- harald
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an operation object not associated to a session.
The session must be set viasetSession(org.tentackle.session.Session)in order to use it.AbstractDbOperation(Db session) Creates an operation object. -
Method Summary
Modifier and TypeMethodDescriptionGets attributes and variables common to all objects of the same class.Gets the delegate for remote connections.
Each class has its own delegate.Get the session for this operation.Gets the session holder.booleanReturns whether the db is immutable.voidsetSession(Session session) Sets the session for this operation.voidsetSessionHolder(SessionHolder sessionHolder) Sets the session holder for this object.voidsetSessionImmutable(boolean sessionImmutable) Sets the db to immutable.
-
Constructor Details
-
AbstractDbOperation
Creates an operation object.- Parameters:
session- the session
-
AbstractDbOperation
public AbstractDbOperation()Creates an operation object not associated to a session.
The session must be set viasetSession(org.tentackle.session.Session)in order to use it.
-
-
Method Details
-
getClassVariables
Gets attributes and variables common to all objects of the same class. Class variables for classes derived fromAbstractDbOperationare kept in an instance ofDbOperationClassVariables.- Returns:
- the class variables
-
setSessionHolder
Sets the session holder for this object.If a holder is set, getSession() will return the session from the holder.
- Parameters:
sessionHolder- the session holder
-
getSessionHolder
Gets the session holder.- Returns:
- the holder, null if none
-
setSessionImmutable
public void setSessionImmutable(boolean sessionImmutable) Sets the db to immutable.- Specified by:
setSessionImmutablein interfaceSessionDependable- Parameters:
sessionImmutable- true if db cannot be changed anymore
-
isSessionImmutable
public boolean isSessionImmutable()Returns whether the db is immutable.- Specified by:
isSessionImmutablein interfaceSessionDependable- Returns:
- true if immutable
-
setSession
Sets the session for this operation.- Specified by:
setSessionin interfaceSessionDependable- Parameters:
session- the session
-
getSession
Get the session for this operation.- Specified by:
getSessionin interfaceSessionProvider- Returns:
- the session
-
getRemoteDelegate
Gets the delegate for remote connections.
Each class has its own delegate.- Returns:
- the delegate for this object
-