Beispiel #1
0
  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;
  }
Beispiel #2
0
  public void update(Employee employee) {
    if (employee == null) {
      throw new NullPointerException("employee is null");
    }

    employeeDao.update(employee);
  }
Beispiel #3
0
 public List<Employee> searchEmployeeByCity(String term) {
   return employeeDao.searchByCity(term);
 }
Beispiel #4
0
 public List<String> getAllEmployeeNames() {
   return employeeDao.getAllEmployeeNames();
 }
Beispiel #5
0
 public List<Employee> getByName(String employee) {
   return employeeDao.getByName(employee);
 }
Beispiel #6
0
 public List<Employee> getAllEmployees() {
   return employeeDao.getAllEmployees();
 }
Beispiel #7
0
 public Employee get(int id) {
   return employeeDao.get(id);
 }
Beispiel #8
0
 public void delete(int id) {
   Employee employee = new Employee();
   employee.setId(id);
   employeeDao.delete(employee);
 }