@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); }
@Override public void update(Artifact artifact) { logger.info("update()"); TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); em.persist(em.merge(artifact)); transactionManager.commit(status); }
@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); }