Skip to content

Instantly share code, notes, and snippets.

@deffence1776
Created Jul 19, 2014
Embed
What would you like to do?
@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