Class DaoSupport

java.lang.Object
org.springframework.dao.support.DaoSupport
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public abstract class DaoSupport extends Object implements org.springframework.beans.factory.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:
  • org.springframework.jdbc.core.support.JdbcDaoSupport
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.apache.commons.logging.Log
    Logger available to subclasses.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
     
    protected abstract void
    Abstract subclasses must override this to check their configuration.
    protected void
    Concrete subclasses can override this for custom initialization behavior.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected final org.apache.commons.logging.Log logger
      Logger available to subclasses.
  • Constructor Details

    • DaoSupport

      public DaoSupport()
  • Method Details

    • afterPropertiesSet

      public final void afterPropertiesSet() throws IllegalArgumentException, org.springframework.beans.factory.BeanInitializationException
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      IllegalArgumentException
      org.springframework.beans.factory.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