public Employee add(Employee employee) { if (employee == null) { throw new NullPointerException("employee is null"); } if (employee.getId() == 0) { long id = employeeDao.generateEmployeeId(); employee.setId(id); } employeeDao.add(employee); return employee; }
public void delete(int id) { Employee employee = new Employee(); employee.setId(id); employeeDao.delete(employee); }