org.springframework.orm.ibatis.support
Class SqlMapDaoSupport

java.lang.Object
  extended byorg.springframework.orm.ibatis.support.SqlMapDaoSupport
All Implemented Interfaces:
InitializingBean

public class SqlMapDaoSupport
extends Object
implements InitializingBean

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

Since:
29.11.2003
Author:
Juergen Hoeller
See Also:
setSqlMap(com.ibatis.db.sqlmap.SqlMap), SqlMapTemplate

Field Summary
protected  Log logger
           
 
Constructor Summary
SqlMapDaoSupport()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 DataSource getDataSource()
          Return the JDBC DataSource used by this DAO.
 com.ibatis.db.sqlmap.SqlMap getSqlMap()
          Return the iBATIS Database Layer SqlMap that this template works with.
 SqlMapTemplate getSqlMapTemplate()
          Return the SqlMapTemplate for this DAO, pre-initialized with the SqlMap or set explicitly.
protected  void initDao()
          Subclasses can override this for custom initialization behavior.
 void setDataSource(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 SqlMapTemplate for this DAO explicitly, as an alternative to specifying a SqlMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Constructor Detail

SqlMapDaoSupport

public SqlMapDaoSupport()
Method Detail

setDataSource

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

See Also:
setSqlMap(com.ibatis.db.sqlmap.SqlMap)

getDataSource

public final 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. Either this or a "sqlMapTemplate" is required.

See Also:
setSqlMapTemplate(org.springframework.orm.ibatis.SqlMapTemplate)

getSqlMap

public 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 SqlMapTemplate for this DAO explicitly, as an alternative to specifying a SqlMap.

See Also:
setSqlMap(com.ibatis.db.sqlmap.SqlMap)

getSqlMapTemplate

public final SqlMapTemplate getSqlMapTemplate()
Return the SqlMapTemplate for this DAO, pre-initialized with the SqlMap or set explicitly.


afterPropertiesSet

public final void afterPropertiesSet()
                              throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

initDao

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

Throws:
Exception - if initialization fails


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