@Override
  public UcdProcessDTO create(UcdProcessDTO dto)
      throws EntityCreationException, EntityRetrievalException {

    UcdProcessEntity entity = null;
    try {
      if (dto.getId() != null) {
        entity = this.getEntityById(dto.getId());
      }
    } catch (EntityRetrievalException e) {
      throw new EntityCreationException(e);
    }

    if (entity != null) {
      throw new EntityCreationException("An entity with this ID already exists.");
    } else {
      entity = new UcdProcessEntity();
      entity.setCreationDate(new Date());
      entity.setDeleted(false);
      entity.setLastModifiedDate(new Date());
      entity.setLastModifiedUser(Util.getCurrentUser().getId());
      entity.setName(dto.getName());

      create(entity);
      return new UcdProcessDTO(entity);
    }
  }
  @Override
  public UcdProcessDTO update(UcdProcessDTO dto) throws EntityRetrievalException {
    UcdProcessEntity entity = this.getEntityById(dto.getId());

    if (entity == null) {
      throw new EntityRetrievalException("Entity with id " + dto.getId() + " does not exist");
    }

    entity.setName(dto.getName());
    entity.setLastModifiedUser(Util.getCurrentUser().getId());
    entity.setLastModifiedDate(new Date());

    update(entity);
    return new UcdProcessDTO(entity);
  }