DAO pattern generic implementation