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 AbstractDbObject
s
and is associated to a Db
-session. Complex transactions are usually
AbstractDbOperation
s. AbstractDbOperation
s are remoting capable.- Author:
- harald
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates 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.boolean
Returns whether the db is immutable.void
setSession
(Session session) Sets the session for this operation.void
setSessionHolder
(SessionHolder sessionHolder) Sets the session holder for this object.void
setSessionImmutable
(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 fromAbstractDbOperation
are 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:
setSessionImmutable
in interfaceSessionDependable
- Parameters:
sessionImmutable
- true if db cannot be changed anymore
-
isSessionImmutable
public boolean isSessionImmutable()Returns whether the db is immutable.- Specified by:
isSessionImmutable
in interfaceSessionDependable
- Returns:
- true if immutable
-
setSession
Sets the session for this operation.- Specified by:
setSession
in interfaceSessionDependable
- Parameters:
session
- the session
-
getSession
Get the session for this operation.- Specified by:
getSession
in interfaceSessionProvider
- Returns:
- the session
-
getRemoteDelegate
Gets the delegate for remote connections.
Each class has its own delegate.- Returns:
- the delegate for this object
-