org.springframework.orm.ibatis.support
Class SqlMapClientDaoSupport


public abstract class SqlMapClientDaoSupport
implements InitializingBean

Convenient super class for iBATIS SqlMapClient data access objects. Requires a SqlMapClient to be set, providing a SqlMapClientTemplate based on it to subclasses.

Instead of a plain SqlMapClient, you can also pass a preconfigured SqlMapClientTemplate instance in. This allows you to share your SqlMapClientTemplate configuration for all your DAOs, for example a custom SQLExceptionTranslator to use.

Author:
Juergen Hoeller
Since: 24.02.2004
See Also: setSqlMapClient(SqlMapClient), setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate), SqlMapClientTemplate, org.springframework.jdbc.support.JdbcAccessor.setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)

Method Summary
 final voidafterPropertiesSet()
           
 final DataSourcegetDataSource()
          Return the JDBC DataSource used by this DAO.
 final SqlMapClientgetSqlMapClient()
          Return the iBATIS Database Layer SqlMapClient that this template works with.
 final SqlMapClientTemplategetSqlMapClientTemplate()
          Return the SqlMapClientTemplate for this DAO, pre-initialized with the SqlMapClient or set explicitly.
 final voidsetDataSource(DataSource dataSource)
          Set the JDBC DataSource to be used by this DAO.
 final voidsetSqlMapClient(SqlMapClient sqlMapClient)
          Set the iBATIS Database Layer SqlMapClient to work with.
 final voidsetSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
          Set the SqlMapClientTemplate for this DAO explicitly, as an alternative to specifying a SqlMapClient.

Method Detail

afterPropertiesSet

public final void afterPropertiesSet()
throws java.lang.Exception

getDataSource

public final DataSource getDataSource()
Return the JDBC DataSource used by this DAO.

getSqlMapClient

public final SqlMapClient getSqlMapClient()
Return the iBATIS Database Layer SqlMapClient that this template works with.

getSqlMapClientTemplate

public final SqlMapClientTemplate getSqlMapClientTemplate()
Return the SqlMapClientTemplate for this DAO, pre-initialized with the SqlMapClient or set explicitly.

setDataSource

public final void setDataSource(DataSource dataSource)
Set the JDBC DataSource to be used by this DAO. Not required: The SqlMapClient might carry a shared DataSource.
See Also:
setSqlMapClient(SqlMapClient)

setSqlMapClient

public final void setSqlMapClient(SqlMapClient sqlMapClient)
Set the iBATIS Database Layer SqlMapClient to work with. Either this or a "sqlMapClientTemplate" is required.
See Also:
setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate)

setSqlMapClientTemplate

public final void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
Set the SqlMapClientTemplate for this DAO explicitly, as an alternative to specifying a SqlMapClient.
See Also:
setSqlMapClient(SqlMapClient)

Association Links

to Class org.springframework.orm.ibatis.SqlMapClientTemplate