Package org.springframework.dao.support
Class DaoSupport
- java.lang.Object
- org.springframework.dao.support.DaoSupport
- All Implemented Interfaces:
InitializingBean
- Direct Known Subclasses:
CciDaoSupport
,HibernateDaoSupport
,JdbcDaoSupport
public abstract class DaoSupport extends Object implements 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.
- Since:
- 1.2.2
- Author:
- Juergen Hoeller
- See Also:
JdbcDaoSupport
Constructor Summary
Constructors Constructor Description DaoSupport()
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.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.
Constructor Detail
DaoSupport
public DaoSupport()
Method Detail
afterPropertiesSet
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException
Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,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.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
IllegalArgumentException
BeanInitializationException
checkDaoConfig
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.- Throws:
IllegalArgumentException
- in case of illegal configuration
initDao
protected void initDao() throws Exception
Concrete subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.- Throws:
Exception
- if DAO initialization fails (will be rethrown as a BeanInitializationException)- See Also:
BeanInitializationException