Ejemplo n.º 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;
  }
Ejemplo n.º 2
0
 public void delete(int id) {
   Employee employee = new Employee();
   employee.setId(id);
   employeeDao.delete(employee);
 }