org.springframework.orm.ibatis.support
Class SqlMapDaoSupport

java.lang.Object
  extended byorg.springframework.orm.ibatis.support.SqlMapDaoSupport

public class SqlMapDaoSupport
extends java.lang.Object

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

Since:
29.11.2003
Author:
Juergen Hoeller
See Also:
SqlMapTemplate

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
SqlMapDaoSupport()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  javax.sql.DataSource getDataSource()
          Return the JDBC DataSource used by this DAO.
protected  com.ibatis.db.sqlmap.SqlMap getSqlMap()
          Return the iBATIS Database Layer SqlMap that this template works with.
protected  SqlMapTemplate getSqlMapTemplate()
          Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly.
protected  void initDao()
          Subclasses can override this for custom initialization behavior.
 void setDataSource(javax.sql.DataSource dataSource)
          Set the JDBC DataSource to be used by this DAO.
 void setSqlMap(com.ibatis.db.sqlmap.SqlMap sqlMap)
          Set the iBATIS Database Layer SqlMap to work with.
 void setSqlMapTemplate(SqlMapTemplate sqlMapTemplate)
          Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

SqlMapDaoSupport

public SqlMapDaoSupport()
Method Detail

setDataSource

public final void setDataSource(javax.sql.DataSource dataSource)
Set the JDBC DataSource to be used by this DAO.


getDataSource

protected final javax.sql.DataSource getDataSource()
Return the JDBC DataSource used by this DAO.


setSqlMap

public final void setSqlMap(com.ibatis.db.sqlmap.SqlMap sqlMap)
Set the iBATIS Database Layer SqlMap to work with.


getSqlMap

protected final com.ibatis.db.sqlmap.SqlMap getSqlMap()
Return the iBATIS Database Layer SqlMap that this template works with.


setSqlMapTemplate

public final void setSqlMapTemplate(SqlMapTemplate sqlMapTemplate)
Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.


getSqlMapTemplate

protected final SqlMapTemplate getSqlMapTemplate()
Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly.


afterPropertiesSet

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

initDao

protected void initDao()
                throws java.lang.Exception
Subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.

Throws:
java.lang.Exception - if initialization fails


Copyright (C) 2003-2004 The Spring Framework Project.