com.ibatis.sqlmap.engine.scope

Class SessionScope

public class SessionScope extends Object

A Session based implementation of the Scope interface
Constructor Summary
SessionScope()
Default constructor
Method Summary
voidcleanup()
voidclosePreparedStatements()
voiddecrementRequestStackDepth()
Decrement the stack depth by one.
booleanequals(Object parameterObject)
ObjectgetBatch()
Getter for the batch of the session
static longgetNextId()
Method to get a unique ID
PreparedStatementgetPreparedStatement(String sql)
intgetRequestStackDepth()
Get the request stack depth
SqlMapClientgetSqlMapClient()
Get the SqlMapClient for the session
SqlMapExecutorgetSqlMapExecutor()
Get the SQL executor for the session
SqlMapTransactionManagergetSqlMapTxMgr()
Get the transaction manager
TransactiongetTransaction()
Getter for the session transaction
TransactionStategetTransactionState()
Getter for the transaction state of the session
inthashCode()
booleanhasPreparedStatement(PreparedStatement ps)
booleanhasPreparedStatementFor(String sql)
voidincrementRequestStackDepth()
Increment the stack depth by one.
booleanisCommitRequired()
Getter to tell if a commit is required for the session
booleanisInBatch()
Tells us if we are in batch mode or not
voidputPreparedStatement(SqlMapExecutorDelegate delegate, String sql, PreparedStatement ps)
voidrecallTransactionState()
Restores the previously saved transaction state
voidsaveTransactionState()
Saves the current transaction state
voidsetBatch(Object batch)
Stter for the batch of the session
voidsetCommitRequired(boolean commitRequired)
Setter to tell the session that a commit is required for the session
voidsetInBatch(boolean inBatch)
Turn batch mode on or off
voidsetSqlMapClient(SqlMapClient sqlMapClient)
Set the SqlMapClient for the session
voidsetSqlMapExecutor(SqlMapExecutor sqlMapExecutor)
Get the SQL executor for the session
voidsetSqlMapTxMgr(SqlMapTransactionManager sqlMapTxMgr)
Set the transaction manager
voidsetTransaction(Transaction transaction)
Setter for the session transaction
voidsetTransactionState(TransactionState transactionState)
Setter for the transaction state of the session

Constructor Detail

SessionScope

public SessionScope()
Default constructor

Method Detail

cleanup

public void cleanup()

closePreparedStatements

public void closePreparedStatements()

decrementRequestStackDepth

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

equals

public boolean equals(Object parameterObject)

getBatch

public Object getBatch()
Getter for the batch of the session

Returns: - the batch

getNextId

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

Returns: - the new ID

getPreparedStatement

public PreparedStatement getPreparedStatement(String sql)

getRequestStackDepth

public int getRequestStackDepth()
Get the request stack depth

Returns: - the stack depth

getSqlMapClient

public SqlMapClient getSqlMapClient()
Get the SqlMapClient for the session

Returns: - the SqlMapClient

getSqlMapExecutor

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

Returns: - the SQL executor

getSqlMapTxMgr

public SqlMapTransactionManager getSqlMapTxMgr()
Get the transaction manager

Returns: - the transaction manager

getTransaction

public Transaction getTransaction()
Getter for the session transaction

Returns: - the transaction

getTransactionState

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

Returns: - the state

hashCode

public int hashCode()

hasPreparedStatement

public boolean hasPreparedStatement(PreparedStatement ps)

hasPreparedStatementFor

public boolean hasPreparedStatementFor(String sql)

incrementRequestStackDepth

public void incrementRequestStackDepth()
Increment 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

isInBatch

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

Returns: - true if we are working with a batch

putPreparedStatement

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

recallTransactionState

public void recallTransactionState()
Restores the previously saved transaction state

saveTransactionState

public void saveTransactionState()
Saves the current transaction state

setBatch

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

Parameters: batch the new batch

setCommitRequired

public void setCommitRequired(boolean commitRequired)
Setter to tell the session that a commit is required for the session

Parameters: commitRequired - the flag

setInBatch

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

Parameters: inBatch - the switch

setSqlMapClient

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

Parameters: sqlMapClient - the SqlMapClient

setSqlMapExecutor

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

Parameters: sqlMapExecutor - the SQL executor

setSqlMapTxMgr

public void setSqlMapTxMgr(SqlMapTransactionManager sqlMapTxMgr)
Set the transaction manager

Parameters: sqlMapTxMgr - the transaction manager

setTransaction

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

Parameters: transaction - the transaction

setTransactionState

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

Parameters: transactionState - the new transaction state

Copyright © 2011. All Rights Reserved.