com.ibatis.sqlmap.engine.scope
Class SessionScope

java.lang.Object
  extended bycom.ibatis.sqlmap.engine.scope.BaseScope
      extended bycom.ibatis.sqlmap.engine.scope.SessionScope
All Implemented Interfaces:
Scope

public class SessionScope
extends BaseScope

A Session based implementation of the Scope interface


Constructor Summary
SessionScope()
          Default constructor
 
Method Summary
 void decrementRequestStackDepth()
          Decrement the stack depth by one.
 boolean equals(java.lang.Object parameterObject)
           
 java.lang.Object getBatch()
          Getter for the batch of the session
static long getNextId()
          Method to get a unique ID
 int getRequestStackDepth()
          Get the request stack depth
 SqlMapClient getSqlMapClient()
          Get the SqlMapClient for the session
 SqlMapExecutor getSqlMapExecutor()
          Get the SQL executor for the session
 SqlMapTransactionManager getSqlMapTxMgr()
          Get the transaction manager
 Transaction getTransaction()
          Getter for the session transaction
 TransactionState getTransactionState()
          Getter for the transaction state of the session
 int hashCode()
           
 void incrementRequestStackDepth()
          Increment the stack depth by one.
 boolean isCommitRequired()
          Getter to tell if a commit is required for the session
 boolean isInBatch()
          Tells us if we are in batch mode or not
 void recallTransactionState()
          Restores the previously saved transaction state
 void reset()
          Clears all data out of the scope
 void saveTransactionState()
          Saves the current transaction state
 void setBatch(java.lang.Object batch)
          Stter for the batch of the session
 void setCommitRequired(boolean commitRequired)
          Setter to tell the session that a commit is required for the session
 void setInBatch(boolean inBatch)
          Turn batch mode on or off
 void setSqlMapClient(SqlMapClient sqlMapClient)
          Set the SqlMapClient for the session
 void setSqlMapExecutor(SqlMapExecutor sqlMapExecutor)
          Get the SQL executor for the session
 void setSqlMapTxMgr(SqlMapTransactionManager sqlMapTxMgr)
          Set the transaction manager
 void setTransaction(Transaction transaction)
          Setter for the session transaction
 void setTransactionState(TransactionState transactionState)
          Setter for the transaction state of the session
 
Methods inherited from class com.ibatis.sqlmap.engine.scope.BaseScope
getAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionScope

public SessionScope()
Default constructor

Method Detail

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 java.lang.Object getBatch()
Getter for the batch of the session

Returns:
- the batch

setBatch

public void setBatch(java.lang.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

reset

public void reset()
Description copied from interface: Scope
Clears all data out of the scope

Specified by:
reset in interface Scope
Overrides:
reset in class BaseScope

equals

public boolean equals(java.lang.Object parameterObject)

hashCode

public int hashCode()

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