@Test public void testExecute() { final long id = 1831L; final long gadgetId = 5039L; List list = getEntityManager().createQuery("FROM GadgetDefinition WHERE id=:id").setParameter("id", id) .getResultList(); assertEquals(1, list.size()); getEntityManager() .createQuery("UPDATE VERSIONED Gadget SET deleted = true, dateDeleted = current_date() WHERE id=:id") .setParameter("id", gadgetId).executeUpdate(); sut.execute(id); list = getEntityManager().createQuery("FROM GadgetDefinition WHERE id=:id").setParameter("id", id) .getResultList(); assertTrue(list.isEmpty()); }
@Override public Void execute(final Long inRequest) { getEntityManager().createQuery("DELETE Gadget WHERE gadgetDefinition.id=:id").setParameter("id", inRequest) .executeUpdate(); getEntityManager().remove(getHibernateSession().load(GadgetDefinition.class, inRequest)); return null; }
DeleteGadgetDefinition extends BaseArgDomainMapper<Long, Void> { @Override public Void execute(final Long inRequest) { getEntityManager().createQuery("DELETE Gadget WHERE gadgetDefinition.id=:id").setParameter("id", inRequest) .executeUpdate(); getEntityManager().remove(getHibernateSession().load(GadgetDefinition.class, inRequest)); return null; } }
DeleteGadgetDefinition extends BaseArgDomainMapper<Long, Void> { @Override public Void execute(final Long inRequest) { getEntityManager().createQuery("DELETE Gadget WHERE gadgetDefinition.id=:id").setParameter("id", inRequest) .executeUpdate(); getEntityManager().remove(getHibernateSession().load(GadgetDefinition.class, inRequest)); return null; }  }
DeleteGadgetDefinition extends BaseArgDomainMapper<Long, Void> { @Override public Void execute(final Long inRequest) { getEntityManager().createQuery("DELETE Gadget WHERE gadgetDefinition.id=:id").setParameter("id", inRequest) .executeUpdate(); getEntityManager().remove(getHibernateSession().load(GadgetDefinition.class, inRequest)); return null; }  @Override Void execute(final Long inRequest); }
DeleteGadgetDefinition extends BaseArgDomainMapper<Long, Void> { @Override public Void execute(final Long inRequest) { getEntityManager().createQuery("DELETE Gadget WHERE gadgetDefinition.id=:id").setParameter("id", inRequest) .executeUpdate(); getEntityManager().remove(getHibernateSession().load(GadgetDefinition.class, inRequest)); return null; }  @Override Void execute(final Long inRequest);  }