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 update(Employee employee) { if (employee == null) { throw new NullPointerException("employee is null"); } employeeDao.update(employee); }
public List<Employee> searchEmployeeByCity(String term) { return employeeDao.searchByCity(term); }
public List<String> getAllEmployeeNames() { return employeeDao.getAllEmployeeNames(); }
public List<Employee> getByName(String employee) { return employeeDao.getByName(employee); }
public List<Employee> getAllEmployees() { return employeeDao.getAllEmployees(); }
public Employee get(int id) { return employeeDao.get(id); }
public void delete(int id) { Employee employee = new Employee(); employee.setId(id); employeeDao.delete(employee); }