public abstract class

SqlSessionDaoSupport

extends DaoSupport
java.lang.Object
   ↳ org.springframework.dao.support.DaoSupport
     ↳ org.mybatis.spring.support.SqlSessionDaoSupport
Known Direct Subclasses

Class Overview

Convenient super class for MyBatis SqlSession data access objects. It gives you access to the template which can then be used to execute SQL methods.

This class needs a SqlSessionTemplate or a SqlSessionFactory. If both are set the SqlSessionFactory will be ignored.

{code Autowired} was removed from setSqlSessionTemplate and setSqlSessionFactory in version 1.2.0.

Summary

[Expand]
Inherited Fields
From class org.springframework.dao.support.DaoSupport
Public Constructors
SqlSessionDaoSupport()
Public Methods
SqlSession getSqlSession()
Users should use this method to get a SqlSession to call its statement methods This is SqlSession is managed by spring.
void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory)
void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
Protected Methods
void checkDaoConfig()
[Expand]
Inherited Methods
From class org.springframework.dao.support.DaoSupport
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public SqlSessionDaoSupport ()

Public Methods

public SqlSession getSqlSession ()

Users should use this method to get a SqlSession to call its statement methods This is SqlSession is managed by spring. Users should not commit/rollback/close it because it will be automatically done.

Returns
  • Spring managed thread safe SqlSession

public void setSqlSessionFactory (SqlSessionFactory sqlSessionFactory)

public void setSqlSessionTemplate (SqlSessionTemplate sqlSessionTemplate)

Protected Methods

protected void checkDaoConfig ()