All DAO classes will extend the GenericDao.java, which includes some common database actions, such as saveOrUpdate() and findByID(). Besides, it is also using to auto-wired the sessionFactory: package com.itblogs.dao; import java.util.List; import java.io.Serializable; import java.lang.reflect.ParameterizedType; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.criterion.Order; import org.hibernate.Criteria; import org.springframework.beans.factory.annotation.Autowired; /**  * @author      Kelvin Hui  * @see              it-blogs.com  *