예제 #1
0
 public void save(EmployeeModel model, Long[] roleUuids) {
   Set<RoleModel> roms = new HashSet<RoleModel>();
   for (Long uuid : roleUuids) {
     RoleModel rm = roleDao.findById(uuid);
     roms.add(rm);
   }
   model.setRoles(roms);
   employeeDao.save(model);
 }
예제 #2
0
  public void update(EmployeeModel model, Long[] roleUuids) {
    EmployeeModel em = new EmployeeModel();
    em = employeeDao.findById(model.getUuid());

    em.setUserName(model.getUserName());
    em.setName(model.getName());
    em.setEmail(model.getEmail());
    em.setPhone(model.getPhone());
    em.setSex(model.getSex());
    em.setAddres(model.getAddres());
    em.setBirthday(model.getBirthday());
    em.setDepartM(model.getDepartM());

    Set<RoleModel> roms = new HashSet<RoleModel>();
    for (Long uuid : roleUuids) {
      RoleModel rm = roleDao.findById(uuid);
      roms.add(rm);
    }
    em.setRoles(roms);
    employeeDao.update(em);
  }