I created a DAO class which is base class for all other DAO classes. I use Spring Framework 4 and Hibernate 4.Question: Is there anything that could be done better? public class GenericDaoImpl<E, I extends Serializable> implements GenericDao<E, I> {    private Class<E> entityClass;    @Autowired    private SessionFactory sessionFactory;    public GenericDaoImpl(Class<E> entityClass) {        this.entityClass = entityClass;    }    @Override    public Session getCurrentSession() {        return sessionFactory.getCurrentSession();    }    @Override    @SuppressWarnings(unchecked)    public List<E> findAll() throws DataAccessException {        return getCurrentSession().createCriteria(entityClass).list();    }    @Override    @SuppressWarnings(unchecked)    public E find(I id) {        return (E) getCurrentSession().get(entityClass, id);    }    @Override    public void create(E e) {        getCurrentSession().save(e);    }    @Override    public void update(E e)  {        getCurrentSession().update(e);    }    @Override    public void delete(E e) {        getCurrentSession().delete(e);    }    @Override    public void flush() {        getCurrentSession().flush();    }}Sample DAO class which extends base DAO class is for example this one:@Repository(articleDao)public class ArticleDaoImpl extends GenericDaoImpl<ArticleEntity, Long> implements ArticleDao {    public ArticleDaoImpl(){        super(ArticleEntity.class);    }}
Create better Base DAO class
java;hibernate;spring