Package de.terrestris.shoguncore.service
Class AbstractDaoService<E extends PersistentObject,D extends GenericHibernateDao<E,Integer>>
- java.lang.Object
-
- de.terrestris.shoguncore.service.AbstractDaoService<E,D>
-
- Direct Known Subclasses:
AbstractCrudService
@Transactional("transactionManager") public abstract class AbstractDaoService<E extends PersistentObject,D extends GenericHibernateDao<E,Integer>> extends ObjectThis abstract service class simply provides a data access object for the typeAbstractDaoService(and a logger).- Author:
- Nils Bühner
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDaoService(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 DgetDao()Class<E>getEntityClass()abstract voidsetDao(D dao)Subclasses must implement this class and annotate it withAutowiredandQualifier! This is necessary as there may be multiple candidates to autowire (due to hierarchy) and we have to configure the correct ones.
-
-
-
Field Detail
-
logger
protected static final org.apache.logging.log4j.Logger logger
The LOGGER instance (that will be available in all subclasses)
-
dao
protected D extends GenericHibernateDao<E,Integer> dao
The data access object
-
-
Method Detail
-
getDao
public D getDao()
- Returns:
- the dao
-
setDao
public abstract void setDao(D dao)
Subclasses must implement this class and annotate it withAutowiredandQualifier! 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
-
-