Top Description Fields Constructors Methods
org.springframework.dao.support

public abstract Class DaoSupport

extends Object
implements InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean
Imports
org.apache.commons.logging.Log, .LogFactory, org.springframework.beans.factory.BeanInitializationException, .InitializingBean

Generic base class for DAOs, defining template methods for DAO initialization.

Extended by Spring's specific DAO support classes, such as: JdbcDaoSupport, JdoDaoSupport, etc.

Author
Juergen Hoeller
Since
1.2.2
See Also
org.springframework.jdbc.core.support.JdbcDaoSupport

Field Summary

Modifier and TypeField and Description
protected final Log
logger

Logger available to subclasses.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

protected abstract void
checkDaoConfig()

Abstract subclasses must override this to check their configuration.

protected void
initDao()

Concrete subclasses can override this for custom initialization behavior.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
protected final Log logger

Logger available to subclasses.

Constructor Detail

DaoSupportback to summary
public DaoSupport()

Method Detail

afterPropertiesSetback to summary
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
checkDaoConfigback to summary
protected abstract void checkDaoConfig() throws IllegalArgumentException

Abstract subclasses must override this to check their configuration.

Implementors should be marked as final if concrete subclasses are not supposed to override this template method themselves.

Exceptions
IllegalArgumentException:
in case of illegal configuration
initDaoback to summary
protected void initDao() throws Exception

Concrete subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.

Exceptions
Exception:
if DAO initialization fails (will be rethrown as a BeanInitializationException)
See Also
org.springframework.beans.factory.BeanInitializationException