Пример #1
0
  @Override
  @Transactional
  public String addFunction(Function function, String createdBy) throws Exception {
    function.setDateCreated(new Date());
    function.setCreatedBy(createdBy);

    getCurrentSession().save(function);

    return function.getId();
  }
Пример #2
0
  @Override
  @Transactional
  public String updateFunction(Function function, String updatedBy) throws Exception {
    Function functionUpdate = findFunction(function.getId());

    functionUpdate.setCd(StringUtils.trim(function.getCd()));
    functionUpdate.setName(StringUtils.trim(function.getName()));
    functionUpdate.setDescription(StringUtils.trim(function.getDescription()));

    functionUpdate.setUpdatedBy(updatedBy);
    functionUpdate.setDateUpdated(new Date());

    getCurrentSession().update(functionUpdate);

    return functionUpdate.getId();
  }