Exemplo n.º 1
0
  /**
   * Saves or updates the entity
   *
   * @param entity the entity to be saved or updated
   * @param isNew true if it is a new entity added for the first time.
   */
  @Transactional
  public void save(Intrant entity, boolean isNew) {

    ImogActor actor = HttpSessionUtil.getCurrentUser();

    if (entity != null) {

      handlerHelper.prepare(entity);
      if (entity.getDeleted() != null) entity.setDeleted(null);

      dao.saveOrUpdate(entity, isNew);
    }
  }
Exemplo n.º 2
0
  /**
   * Removes the specified entity from the database
   *
   * @param entity The entity to be deleted
   */
  @Transactional
  public void delete(Intrant entity) {

    handlerHelper.prepareForDelete(entity);
    dao.saveOrUpdate(entity, false);
  }