Class SessionScope

java.lang.Object
com.ibatis.sqlmap.engine.scope.SessionScope

public class SessionScope extends Object
A Session based implementation of the Scope interface.
  • Constructor Details

    • SessionScope

      public SessionScope()
      Default constructor.
  • Method Details

    • getSqlMapClient

      public SqlMapClient getSqlMapClient()
      Get the SqlMapClient for the session.
      Returns:
      - the SqlMapClient
    • setSqlMapClient

      public void setSqlMapClient(SqlMapClient sqlMapClient)
      Set the SqlMapClient for the session.
      Parameters:
      sqlMapClient - - the SqlMapClient
    • getSqlMapExecutor

      public SqlMapExecutor getSqlMapExecutor()
      Get the SQL executor for the session.
      Returns:
      - the SQL executor
    • setSqlMapExecutor

      public void setSqlMapExecutor(SqlMapExecutor sqlMapExecutor)
      Get the SQL executor for the session.
      Parameters:
      sqlMapExecutor - - the SQL executor
    • getSqlMapTxMgr

      public SqlMapTransactionManager getSqlMapTxMgr()
      Get the transaction manager.
      Returns:
      - the transaction manager
    • setSqlMapTxMgr

      public void setSqlMapTxMgr(SqlMapTransactionManager sqlMapTxMgr)
      Set the transaction manager.
      Parameters:
      sqlMapTxMgr - - the transaction manager
    • isInBatch

      public boolean isInBatch()
      Tells us if we are in batch mode or not.
      Returns:
      - true if we are working with a batch
    • setInBatch

      public void setInBatch(boolean inBatch)
      Turn batch mode on or off.
      Parameters:
      inBatch - - the switch
    • getTransaction

      public Transaction getTransaction()
      Getter for the session transaction.
      Returns:
      - the transaction
    • setTransaction

      public void setTransaction(Transaction transaction)
      Setter for the session transaction.
      Parameters:
      transaction - - the transaction
    • getTransactionState

      public TransactionState getTransactionState()
      Getter for the transaction state of the session.
      Returns:
      - the state
    • setTransactionState

      public void setTransactionState(TransactionState transactionState)
      Setter for the transaction state of the session.
      Parameters:
      transactionState - - the new transaction state
    • getBatch

      public Object getBatch()
      Getter for the batch of the session.
      Returns:
      - the batch
    • setBatch

      public void setBatch(Object batch)
      Stter for the batch of the session.
      Parameters:
      batch - the new batch
    • getRequestStackDepth

      public int getRequestStackDepth()
      Get the request stack depth.
      Returns:
      - the stack depth
    • incrementRequestStackDepth

      public void incrementRequestStackDepth()
      Increment the stack depth by one.
    • decrementRequestStackDepth

      public void decrementRequestStackDepth()
      Decrement the stack depth by one.
    • isCommitRequired

      public boolean isCommitRequired()
      Getter to tell if a commit is required for the session.
      Returns:
      - true if a commit is required
    • setCommitRequired

      public void setCommitRequired(boolean commitRequired)
      Setter to tell the session that a commit is required for the session.
      Parameters:
      commitRequired - - the flag
    • hasPreparedStatementFor

      public boolean hasPreparedStatementFor(String sql)
      Checks for prepared statement for.
      Parameters:
      sql - the sql
      Returns:
      true, if successful
    • hasPreparedStatement

      public boolean hasPreparedStatement(PreparedStatement ps)
      Checks for prepared statement.
      Parameters:
      ps - the ps
      Returns:
      true, if successful
    • getPreparedStatement

      public PreparedStatement getPreparedStatement(String sql) throws SQLException
      Gets the prepared statement.
      Parameters:
      sql - the sql
      Returns:
      the prepared statement
      Throws:
      SQLException - the SQL exception
    • putPreparedStatement

      public void putPreparedStatement(SqlMapExecutorDelegate delegate, String sql, PreparedStatement ps)
      Put prepared statement.
      Parameters:
      delegate - the delegate
      sql - the sql
      ps - the ps
    • closePreparedStatements

      public void closePreparedStatements()
      Close prepared statements.
    • cleanup

      public void cleanup()
      Cleanup.
    • equals

      public boolean equals(Object parameterObject)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getNextId

      public static long getNextId()
      Method to get a unique ID.
      Returns:
      - the new ID
    • saveTransactionState

      public void saveTransactionState()
      Saves the current transaction state.
    • recallTransactionState

      public void recallTransactionState()
      Restores the previously saved transaction state.