org.springframework.orm.ibatis.support
abstract public class: SqlMapClientDaoSupport [javadoc |
source]
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
All Implemented Interfaces:
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.
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.orm.ibatis.support.SqlMapClientDaoSupport Detail: |
protected final void checkDaoConfig() {
if (!this.externalTemplate) {
this.sqlMapClientTemplate.afterPropertiesSet();
}
}
|
public final DataSource getDataSource() {
return this.sqlMapClientTemplate.getDataSource();
}
Return the JDBC DataSource used by this DAO. |
public final SqlMapClient getSqlMapClient() {
return this.sqlMapClientTemplate.getSqlMapClient();
}
Return the iBATIS Database Layer SqlMapClient that this template works with. |
public final SqlMapClientTemplate getSqlMapClientTemplate() {
return this.sqlMapClientTemplate;
}
Return the SqlMapClientTemplate for this DAO,
pre-initialized with the SqlMapClient or set explicitly. |
public final void setDataSource(DataSource dataSource) {
if (!this.externalTemplate) {
this.sqlMapClientTemplate.setDataSource(dataSource);
}
}
Set the JDBC DataSource to be used by this DAO.
Not required: The SqlMapClient might carry a shared DataSource. |
public final void setSqlMapClient(SqlMapClient sqlMapClient) {
if (!this.externalTemplate) {
this.sqlMapClientTemplate.setSqlMapClient(sqlMapClient);
}
}
Set the iBATIS Database Layer SqlMapClient to work with.
Either this or a "sqlMapClientTemplate" is required. |
public final void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate) {
Assert.notNull(sqlMapClientTemplate, "SqlMapClientTemplate must not be null");
this.sqlMapClientTemplate = sqlMapClientTemplate;
this.externalTemplate = true;
}
Set the SqlMapClientTemplate for this DAO explicitly,
as an alternative to specifying a SqlMapClient. |