org.mybatis.spring
Interface SqlSessionOperations

All Known Implementing Classes:
SqlSessionTemplate

public interface SqlSessionOperations

Interface that specifies a basic set of MyBatis SqlSession operations, implemented by SqlSessionTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed. Defines SqlSessionTemplate's convenience methods that mirror the MyBatis SqlSession's execution methods. Users are strongly encouraged to read the MyBatis javadocs for details on the semantics of those methods.

Version:
$Id: SqlSessionOperations.java 2981 2010-10-31 19:00:33Z eduardo.macarron $
See Also:
SqlSessionTemplate, SqlSession

Method Summary
 int delete(String statement)
           
 int delete(String statement, Object parameter)
           
<T> T
getMapper(Class<T> type)
           
 int insert(String statement)
           
 int insert(String statement, Object parameter)
           
 void select(String statement, Object parameter, org.apache.ibatis.session.ResultHandler handler)
           
 void select(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler handler)
           
 void select(String statement, org.apache.ibatis.session.ResultHandler handler)
           
<T> List<T>
selectList(String statement)
           
<T> List<T>
selectList(String statement, Object parameter)
           
<T> List<T>
selectList(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds)
           
 Object selectOne(String statement)
           
 Object selectOne(String statement, Object parameter)
           
 int update(String statement)
           
 int update(String statement, Object parameter)
           
 

Method Detail

selectOne

Object selectOne(String statement)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.selectOne(String)

selectOne

Object selectOne(String statement,
                 Object parameter)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.selectOne(String, Object)

selectList

<T> List<T> selectList(String statement)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.selectList(String, Object)

selectList

<T> List<T> selectList(String statement,
                       Object parameter)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.selectList(String, Object)

selectList

<T> List<T> selectList(String statement,
                       Object parameter,
                       org.apache.ibatis.session.RowBounds rowBounds)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.selectList(String, Object, org.apache.ibatis.session.RowBounds)

select

void select(String statement,
            Object parameter,
            org.apache.ibatis.session.ResultHandler handler)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.select(String, Object, org.apache.ibatis.session.ResultHandler)

select

void select(String statement,
            org.apache.ibatis.session.ResultHandler handler)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.select(String, org.apache.ibatis.session.ResultHandler)

select

void select(String statement,
            Object parameter,
            org.apache.ibatis.session.RowBounds rowBounds,
            org.apache.ibatis.session.ResultHandler handler)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.select(String, Object, org.apache.ibatis.session.RowBounds, org.apache.ibatis.session.ResultHandler)

insert

int insert(String statement)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.insert(String)

insert

int insert(String statement,
           Object parameter)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.insert(String, Object)

update

int update(String statement)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.update(String)

update

int update(String statement,
           Object parameter)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.update(String, Object)

delete

int delete(String statement)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.delete(String)

delete

int delete(String statement,
           Object parameter)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.delete(String, Object)

getMapper

<T> T getMapper(Class<T> type)
Throws:
org.springframework.dao.DataAccessException - in case of errors
See Also:
SqlSession.getMapper(Class)


Copyright © 2010 MyBatis.org. All Rights Reserved.