Exemplo n.º 1
0
  @Override
  public void delete(Artifact artifact) {

    logger.info("delete(Artifact(" + artifact.getId() + "))");

    TransactionStatus status =
        transactionManager.getTransaction(new DefaultTransactionDefinition());
    em.remove(em.merge(artifact));
    transactionManager.commit(status);
  }
Exemplo n.º 2
0
  @Override
  public void update(Artifact artifact) {

    logger.info("update()");

    TransactionStatus status =
        transactionManager.getTransaction(new DefaultTransactionDefinition());
    em.persist(em.merge(artifact));
    transactionManager.commit(status);
  }
Exemplo n.º 3
0
  @Override
  public void delete(Long id) {

    logger.info("delete(" + id + ")");

    TransactionStatus status =
        transactionManager.getTransaction(new DefaultTransactionDefinition());
    em.createNamedQuery(Artifact.Q_DELETE_BY_ID, Artifact.class)
        .setParameter("id", id)
        .executeUpdate();
    transactionManager.commit(status);
  }