Exemplo n.º 1
0
  /**
   * Updates/Creates worker
   *
   * @param map HashMap is analaog to SkillType class
   * @return Optional Business message
   * @throws Exception
   */
  public String saveItem(HashMap map) throws Exception {
    String rtn = ITEM_SAVED_OK_MSG;
    PolicySF psf = ServiceLocator.getPolicySFLocal();
    SkillType skillType = new SkillType();
    CopyUtils.copyProperties(skillType, map);
    long id = skillType.getId();

    if (id > 0) {
      psf.update(skillType);
    } else {

      id = psf.create(skillType);
      skillType.setId(id);
      if (id <= 0) {
        logger.error("SkillType not created.");
      } else {
        logger.info("SkillType created sucessfully id: " + id);
      }
    }

    if (id > 0) {
      LookupMgr.reloadCDLV(SkillTypeRef.class);
    }
    return rtn;
  }