Class AbstractDaoService<E extends PersistentObject,​D extends GenericHibernateDao<E,​java.lang.Integer>>

  • Direct Known Subclasses:
    AbstractCrudService

    @Transactional("transactionManager")
    public abstract class AbstractDaoService<E extends PersistentObject,​D extends GenericHibernateDao<E,​java.lang.Integer>>
    extends java.lang.Object
    This abstract service class simply provides a data access object for the type AbstractDaoService (and a logger).
    Author:
    Nils Bühner
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected D dao
      The data access object
      protected static org.apache.logging.log4j.Logger logger
      The LOGGER instance (that will be available in all subclasses)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractDaoService​(java.lang.Class<E> entityClass)
      Constructor that sets the concrete entity class for the service.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      D getDao()  
      java.lang.Class<E> getEntityClass()  
      abstract void setDao​(D dao)
      Subclasses must implement this class and annotate it with Autowired and Qualifier!
      • Methods inherited from class java.lang.Object

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

      • logger

        protected static final org.apache.logging.log4j.Logger logger
        The LOGGER instance (that will be available in all subclasses)
    • Constructor Detail

      • AbstractDaoService

        protected AbstractDaoService​(java.lang.Class<E> entityClass)
        Constructor that sets the concrete entity class for the service. Subclasses MUST call this constructor.
    • Method Detail

      • getDao

        public D getDao()
        Returns:
        the dao
      • setDao

        public abstract void setDao​(D dao)
        Subclasses must implement this class and annotate it with Autowired and Qualifier! This is necessary as there may be multiple candidates to autowire (due to hierarchy) and we have to configure the correct ones.
        Parameters:
        dao - the dao to set
      • getEntityClass

        public java.lang.Class<E> getEntityClass()
        Returns:
        the entityClass