类 DaoSupport
- java.lang.Object
- org.springframework.dao.support.DaoSupport
- 所有已实现的接口:
InitializingBean
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.
- 从以下版本开始:
- 1.2.2
- 作者:
- Juergen Hoeller
- 另请参阅:
JdbcDaoSupport
构造器概要
构造器 构造器 说明 DaoSupport()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.protected abstract voidcheckDaoConfig()Abstract subclasses must override this to check their configuration.protected voidinitDao()Concrete subclasses can override this for custom initialization behavior.
构造器详细资料
DaoSupport
public DaoSupport()
方法详细资料
afterPropertiesSet
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException
从接口复制的说明:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
checkDaoConfig
protected abstract void checkDaoConfig() throws IllegalArgumentException
Abstract subclasses must override this to check their configuration.Implementors should be marked as
finalif concrete subclasses are not supposed to override this template method themselves.- 抛出:
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.- 抛出:
Exception- if DAO initialization fails (will be rethrown as a BeanInitializationException)- 另请参阅:
BeanInitializationException