|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ibatis.session.SqlSessionManager
public class SqlSessionManager
| Method Summary | ||
|---|---|---|
void |
clearCache()
Clears local session cache |
|
void |
close()
Closes the session |
|
void |
commit()
Flushes batch statements and commits database connection. |
|
void |
commit(boolean force)
Flushes batch statements and commits database connection. |
|
int |
delete(String statement)
Execute a delete statement. |
|
int |
delete(String statement,
Object parameter)
Execute a delete statement. |
|
List<BatchResult> |
flushStatements()
Flushes batch statements. |
|
Configuration |
getConfiguration()
Retrieves current configuration |
|
Connection |
getConnection()
Retrieves inner database connection |
|
|
getMapper(Class<T> type)
Retrieves a mapper. |
|
int |
insert(String statement)
Execute an insert statement. |
|
int |
insert(String statement,
Object parameter)
Execute an insert statement with the given parameter object. |
|
boolean |
isManagedSessionStarted()
|
|
static SqlSessionManager |
newInstance(InputStream inputStream)
|
|
static SqlSessionManager |
newInstance(InputStream inputStream,
Properties properties)
|
|
static SqlSessionManager |
newInstance(InputStream inputStream,
String environment)
|
|
static SqlSessionManager |
newInstance(Reader reader)
|
|
static SqlSessionManager |
newInstance(Reader reader,
Properties properties)
|
|
static SqlSessionManager |
newInstance(Reader reader,
String environment)
|
|
static SqlSessionManager |
newInstance(SqlSessionFactory sqlSessionFactory)
|
|
SqlSession |
openSession()
|
|
SqlSession |
openSession(boolean autoCommit)
|
|
SqlSession |
openSession(Connection connection)
|
|
SqlSession |
openSession(ExecutorType execType)
|
|
SqlSession |
openSession(ExecutorType execType,
boolean autoCommit)
|
|
SqlSession |
openSession(ExecutorType execType,
Connection connection)
|
|
SqlSession |
openSession(ExecutorType execType,
TransactionIsolationLevel level)
|
|
SqlSession |
openSession(TransactionIsolationLevel level)
|
|
void |
rollback()
Discards pending batch statements and rolls database connection back. |
|
void |
rollback(boolean force)
Discards pending batch statements and rolls database connection back. |
|
void |
select(String statement,
Object parameter,
ResultHandler handler)
Retrieve a single row mapped from the statement key and parameter using a ResultHandler. |
|
void |
select(String statement,
Object parameter,
RowBounds rowBounds,
ResultHandler handler)
Retrieve a single row mapped from the statement key and parameter using a ResultHandler and RowBounds |
|
void |
select(String statement,
ResultHandler handler)
Retrieve a single row mapped from the statement using a ResultHandler. |
|
|
selectList(String statement)
Retrieve a list of mapped objects from the statement key and parameter. |
|
|
selectList(String statement,
Object parameter)
Retrieve a list of mapped objects from the statement key and parameter. |
|
|
selectList(String statement,
Object parameter,
RowBounds rowBounds)
Retrieve a list of mapped objects from the statement key and parameter, within the specified row bounds. |
|
|
selectMap(String statement,
Object parameter,
String mapKey)
The selectMap is a special case in that it is designed to convert a list of results into a Map based on one of the properties in the resulting objects. |
|
|
selectMap(String statement,
Object parameter,
String mapKey,
RowBounds rowBounds)
The selectMap is a special case in that it is designed to convert a list of results into a Map based on one of the properties in the resulting objects. |
|
|
selectMap(String statement,
String mapKey)
The selectMap is a special case in that it is designed to convert a list of results into a Map based on one of the properties in the resulting objects. |
|
|
selectOne(String statement)
Retrieve a single row mapped from the statement key |
|
|
selectOne(String statement,
Object parameter)
Retrieve a single row mapped from the statement key and parameter. |
|
void |
startManagedSession()
|
|
void |
startManagedSession(boolean autoCommit)
|
|
void |
startManagedSession(Connection connection)
|
|
void |
startManagedSession(ExecutorType execType)
|
|
void |
startManagedSession(ExecutorType execType,
boolean autoCommit)
|
|
void |
startManagedSession(ExecutorType execType,
Connection connection)
|
|
void |
startManagedSession(ExecutorType execType,
TransactionIsolationLevel level)
|
|
void |
startManagedSession(TransactionIsolationLevel level)
|
|
int |
update(String statement)
Execute an update statement. |
|
int |
update(String statement,
Object parameter)
Execute an update statement. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SqlSessionManager newInstance(Reader reader)
public static SqlSessionManager newInstance(Reader reader,
String environment)
public static SqlSessionManager newInstance(Reader reader,
Properties properties)
public static SqlSessionManager newInstance(InputStream inputStream)
public static SqlSessionManager newInstance(InputStream inputStream,
String environment)
public static SqlSessionManager newInstance(InputStream inputStream,
Properties properties)
public static SqlSessionManager newInstance(SqlSessionFactory sqlSessionFactory)
public void startManagedSession()
public void startManagedSession(boolean autoCommit)
public void startManagedSession(Connection connection)
public void startManagedSession(TransactionIsolationLevel level)
public void startManagedSession(ExecutorType execType)
public void startManagedSession(ExecutorType execType,
boolean autoCommit)
public void startManagedSession(ExecutorType execType,
TransactionIsolationLevel level)
public void startManagedSession(ExecutorType execType,
Connection connection)
public boolean isManagedSessionStarted()
public SqlSession openSession()
openSession in interface SqlSessionFactorypublic SqlSession openSession(boolean autoCommit)
openSession in interface SqlSessionFactorypublic SqlSession openSession(Connection connection)
openSession in interface SqlSessionFactorypublic SqlSession openSession(TransactionIsolationLevel level)
openSession in interface SqlSessionFactorypublic SqlSession openSession(ExecutorType execType)
openSession in interface SqlSessionFactory
public SqlSession openSession(ExecutorType execType,
boolean autoCommit)
openSession in interface SqlSessionFactory
public SqlSession openSession(ExecutorType execType,
TransactionIsolationLevel level)
openSession in interface SqlSessionFactory
public SqlSession openSession(ExecutorType execType,
Connection connection)
openSession in interface SqlSessionFactorypublic Configuration getConfiguration()
SqlSession
getConfiguration in interface SqlSessiongetConfiguration in interface SqlSessionFactorypublic <T> T selectOne(String statement)
SqlSession
selectOne in interface SqlSessionT - the returned object type
public <T> T selectOne(String statement,
Object parameter)
SqlSession
selectOne in interface SqlSessionT - the returned object typestatement - Unique identifier matching the statement to use.parameter - A parameter object to pass to the statement.
public <K,V> Map<K,V> selectMap(String statement,
String mapKey)
SqlSession
selectMap in interface SqlSessionK - the returned Map keys typeV - the returned Map values typestatement - Unique identifier matching the statement to use.mapKey - The property to use as key for each value in the list.
public <K,V> Map<K,V> selectMap(String statement,
Object parameter,
String mapKey)
SqlSession
selectMap in interface SqlSessionK - the returned Map keys typeV - the returned Map values typestatement - Unique identifier matching the statement to use.parameter - A parameter object to pass to the statement.mapKey - The property to use as key for each value in the list.
public <K,V> Map<K,V> selectMap(String statement,
Object parameter,
String mapKey,
RowBounds rowBounds)
SqlSession
selectMap in interface SqlSessionK - the returned Map keys typeV - the returned Map values typestatement - Unique identifier matching the statement to use.parameter - A parameter object to pass to the statement.mapKey - The property to use as key for each value in the list.rowBounds - Bounds to limit object retrieval
public <E> List<E> selectList(String statement)
SqlSession
selectList in interface SqlSessionE - the returned list element typestatement - Unique identifier matching the statement to use.
public <E> List<E> selectList(String statement,
Object parameter)
SqlSession
selectList in interface SqlSessionE - the returned list element typestatement - Unique identifier matching the statement to use.parameter - A parameter object to pass to the statement.
public <E> List<E> selectList(String statement,
Object parameter,
RowBounds rowBounds)
SqlSession
selectList in interface SqlSessionE - the returned list element typestatement - Unique identifier matching the statement to use.parameter - A parameter object to pass to the statement.rowBounds - Bounds to limit object retrieval
public void select(String statement,
ResultHandler handler)
SqlSessionResultHandler.
select in interface SqlSessionstatement - Unique identifier matching the statement to use.handler - ResultHandler that will handle each retrieved row
public void select(String statement,
Object parameter,
ResultHandler handler)
SqlSessionResultHandler.
select in interface SqlSessionstatement - Unique identifier matching the statement to use.parameter - A parameter object to pass to the statement.handler - ResultHandler that will handle each retrieved row
public void select(String statement,
Object parameter,
RowBounds rowBounds,
ResultHandler handler)
SqlSessionResultHandler and RowBounds
select in interface SqlSessionstatement - Unique identifier matching the statement to use.rowBounds - RowBound instance to limit the query resultshandler - ResultHandler that will handle each retrieved rowpublic int insert(String statement)
SqlSession
insert in interface SqlSessionstatement - Unique identifier matching the statement to execute.
public int insert(String statement,
Object parameter)
SqlSession
insert in interface SqlSessionstatement - Unique identifier matching the statement to execute.parameter - A parameter object to pass to the statement.
public int update(String statement)
SqlSession
update in interface SqlSessionstatement - Unique identifier matching the statement to execute.
public int update(String statement,
Object parameter)
SqlSession
update in interface SqlSessionstatement - Unique identifier matching the statement to execute.parameter - A parameter object to pass to the statement.
public int delete(String statement)
SqlSession
delete in interface SqlSessionstatement - Unique identifier matching the statement to execute.
public int delete(String statement,
Object parameter)
SqlSession
delete in interface SqlSessionstatement - Unique identifier matching the statement to execute.parameter - A parameter object to pass to the statement.
public <T> T getMapper(Class<T> type)
SqlSession
getMapper in interface SqlSessionT - the mapper typetype - Mapper interface class
public Connection getConnection()
SqlSession
getConnection in interface SqlSessionpublic void clearCache()
SqlSession
clearCache in interface SqlSessionpublic void commit()
SqlSessionSqlSession.commit(boolean)
commit in interface SqlSessionpublic void commit(boolean force)
SqlSession
commit in interface SqlSessionforce - forces connection commitpublic void rollback()
SqlSessionSqlSession.rollback(boolean)
rollback in interface SqlSessionpublic void rollback(boolean force)
SqlSession
rollback in interface SqlSessionforce - forces connection rollbackpublic List<BatchResult> flushStatements()
SqlSession
flushStatements in interface SqlSessionpublic void close()
SqlSession
close in interface SqlSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||