Skip to content

Instantly share code, notes, and snippets.

@deffence1776
Created July 19, 2014 03:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save deffence1776/35d6d4bfed3fe9d1615f to your computer and use it in GitHub Desktop.
@Repository
public class EmpRepositoryImpl implements EmployeeRepository {
@Autowired
protected EmpDao empDao;
@Override
public List<Employee> findAll() {
List<Employee> employeeList = Lists.newArrayList();
empDao.find().forEach(e ->
employeeList.add(new Employee(e.getEmpId(), e.getEmpName()))
);
return employeeList;
}
@Override
public int save(Employee emp) {
return empDao.save(new Emp(emp.getId(),emp.getName())).getCount();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment