com.ibatis.sqlmap.engine.scope
Class SessionScope

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

public class SessionScope
extends java.lang.Object

A Session based implementation of the Scope interface


构造器摘要
SessionScope()
          Default constructor
 
方法摘要
 void cleanup()
           
 void closePreparedStatements()
           
 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
 java.sql.PreparedStatement getPreparedStatement(java.lang.String sql)
           
 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()
           
 boolean hasPreparedStatement(java.sql.PreparedStatement ps)
           
 boolean hasPreparedStatementFor(java.lang.String sql)
           
 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 putPreparedStatement(SqlMapExecutorDelegate delegate, java.lang.String sql, java.sql.PreparedStatement ps)
           
 void recallTransactionState()
          Restores the previously saved transaction state
 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
 
类方法继承: java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

构造器详细信息

SessionScope

public SessionScope()
Default constructor

方法详细信息

getSqlMapClient

public SqlMapClient getSqlMapClient()
Get the SqlMapClient for the session

返回:
- the SqlMapClient

setSqlMapClient

public void setSqlMapClient(SqlMapClient sqlMapClient)
Set the SqlMapClient for the session

参数:
sqlMapClient - - the SqlMapClient

getSqlMapExecutor

public SqlMapExecutor getSqlMapExecutor()
Get the SQL executor for the session

返回:
- the SQL executor

setSqlMapExecutor

public void setSqlMapExecutor(SqlMapExecutor sqlMapExecutor)
Get the SQL executor for the session

参数:
sqlMapExecutor - - the SQL executor

getSqlMapTxMgr

public SqlMapTransactionManager getSqlMapTxMgr()
Get the transaction manager

返回:
- the transaction manager

setSqlMapTxMgr

public void setSqlMapTxMgr(SqlMapTransactionManager sqlMapTxMgr)
Set the transaction manager

参数:
sqlMapTxMgr - - the transaction manager

isInBatch

public boolean isInBatch()
Tells us if we are in batch mode or not

返回:
- true if we are working with a batch

setInBatch

public void setInBatch(boolean inBatch)
Turn batch mode on or off

参数:
inBatch - - the switch

getTransaction

public Transaction getTransaction()
Getter for the session transaction

返回:
- the transaction

setTransaction

public void setTransaction(Transaction transaction)
Setter for the session transaction

参数:
transaction - - the transaction

getTransactionState

public TransactionState getTransactionState()
Getter for the transaction state of the session

返回:
- the state

setTransactionState

public void setTransactionState(TransactionState transactionState)
Setter for the transaction state of the session

参数:
transactionState - - the new transaction state

getBatch

public java.lang.Object getBatch()
Getter for the batch of the session

返回:
- the batch

setBatch

public void setBatch(java.lang.Object batch)
Stter for the batch of the session

参数:
batch - the new batch

getRequestStackDepth

public int getRequestStackDepth()
Get the request stack depth

返回:
- 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

返回:
- 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

参数:
commitRequired - - the flag

hasPreparedStatementFor

public boolean hasPreparedStatementFor(java.lang.String sql)

hasPreparedStatement

public boolean hasPreparedStatement(java.sql.PreparedStatement ps)

getPreparedStatement

public java.sql.PreparedStatement getPreparedStatement(java.lang.String sql)
                                                throws java.sql.SQLException
抛出异常:
java.sql.SQLException

putPreparedStatement

public void putPreparedStatement(SqlMapExecutorDelegate delegate,
                                 java.lang.String sql,
                                 java.sql.PreparedStatement ps)

closePreparedStatements

public void closePreparedStatements()

cleanup

public void cleanup()

equals

public boolean equals(java.lang.Object parameterObject)
重写:
equals in class java.lang.Object

hashCode

public int hashCode()
重写:
hashCode in class java.lang.Object

getNextId

public static long getNextId()
Method to get a unique ID

返回:
- the new ID

saveTransactionState

public void saveTransactionState()
Saves the current transaction state


recallTransactionState

public void recallTransactionState()
Restores the previously saved transaction state