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 Details

    • AbstractDbOperation

      public AbstractDbOperation(Db session)
      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 via setSession(org.tentackle.session.Session) in order to use it.
  • Method Details

    • getClassVariables

      public DbOperationClassVariables<P> getClassVariables()
      Gets attributes and variables common to all objects of the same class. Class variables for classes derived from AbstractDbOperation are kept in an instance of DbOperationClassVariables.
      Returns:
      the class variables
    • setSessionHolder

      public void setSessionHolder(SessionHolder sessionHolder)
      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

      public SessionHolder 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 interface SessionDependable
      Parameters:
      sessionImmutable - true if db cannot be changed anymore
    • isSessionImmutable

      public boolean isSessionImmutable()
      Returns whether the db is immutable.
      Specified by:
      isSessionImmutable in interface SessionDependable
      Returns:
      true if immutable
    • setSession

      public void setSession(Session session)
      Sets the session for this operation.
      Specified by:
      setSession in interface SessionDependable
      Parameters:
      session - the session
    • getSession

      public Db getSession()
      Get the session for this operation.
      Specified by:
      getSession in interface SessionProvider
      Returns:
      the session
    • getRemoteDelegate

      public AbstractDbOperationRemoteDelegate<P> getRemoteDelegate()
      Gets the delegate for remote connections.
      Each class has its own delegate.
      Returns:
      the delegate for this object