示例#1
0
  /** {@inheritDoc} */
  @Override
  public Amendment create(final PropertyMap properties, final UserExecutionContext context) {

    final String name = properties.get("name");
    final Integer projectId = properties.get("projectId");
    final Project project = projectDAO.findById(projectId);

    return createAmendment(project, name);
  }
示例#2
0
  /** {@inheritDoc} */
  @Override
  @Transactional
  public Amendment update(
      final Integer entityId, final PropertyMap changes, final UserExecutionContext context) {

    Amendment amendment = amendmentDAO.findById(entityId);

    amendment.setName((String) changes.get("name"));

    em().persist(amendment);

    em().flush();

    return amendment;
  }