@Test public void test() { Long total = (Long) getEntityManager().createQuery("SELECT COUNT(id) FROM Person").getSingleResult(); assertTrue(total > 0); getEntityManager().createQuery("UPDATE Person SET accountLocked = false").executeUpdate(); sut.execute(new SetPersonLockedStatusRequest("fordp", true)); List<String> oddball = getEntityManager().createQuery( "SELECT accountId FROM Person WHERE accountLocked = :lockedStatus").setParameter("lockedStatus", true) .getResultList(); assertEquals(1, oddball.size()); assertEquals("fordp", oddball.get(0)); getEntityManager().createQuery("UPDATE Person SET accountLocked = true").executeUpdate(); sut.execute(new SetPersonLockedStatusRequest("fordp", false)); oddball = getEntityManager().createQuery("SELECT accountId FROM Person WHERE accountLocked = :lockedStatus") .setParameter("lockedStatus", false).getResultList(); assertEquals(1, oddball.size()); assertEquals("fordp", oddball.get(0)); }
@Override public Boolean execute(final SetPersonLockedStatusRequest inRequest) { getEntityManager().createQuery( "UPDATE Person SET accountLocked = :lockedStatus WHERE accountId = :personAccountId").setParameter( "lockedStatus", inRequest.getLockedStatus()).setParameter("personAccountId", inRequest.getPersonAccountId()).executeUpdate(); return true; }
SetPersonLockedStatus extends BaseArgDomainMapper<SetPersonLockedStatusRequest, Boolean> { @Override public Boolean execute(final SetPersonLockedStatusRequest inRequest) { getEntityManager().createQuery( "UPDATE Person SET accountLocked = :lockedStatus WHERE accountId = :personAccountId").setParameter( "lockedStatus", inRequest.getLockedStatus()).setParameter("personAccountId", inRequest.getPersonAccountId()).executeUpdate(); return true; } }
SetPersonLockedStatus extends BaseArgDomainMapper<SetPersonLockedStatusRequest, Boolean> { @Override public Boolean execute(final SetPersonLockedStatusRequest inRequest) { getEntityManager().createQuery( "UPDATE Person SET accountLocked = :lockedStatus WHERE accountId = :personAccountId").setParameter( "lockedStatus", inRequest.getLockedStatus()).setParameter("personAccountId", inRequest.getPersonAccountId()).executeUpdate(); return true; }  }
SetPersonLockedStatus extends BaseArgDomainMapper<SetPersonLockedStatusRequest, Boolean> { @Override public Boolean execute(final SetPersonLockedStatusRequest inRequest) { getEntityManager().createQuery( "UPDATE Person SET accountLocked = :lockedStatus WHERE accountId = :personAccountId").setParameter( "lockedStatus", inRequest.getLockedStatus()).setParameter("personAccountId", inRequest.getPersonAccountId()).executeUpdate(); return true; }  @Override Boolean execute(final SetPersonLockedStatusRequest inRequest); }
SetPersonLockedStatus extends BaseArgDomainMapper<SetPersonLockedStatusRequest, Boolean> { @Override public Boolean execute(final SetPersonLockedStatusRequest inRequest) { getEntityManager().createQuery( "UPDATE Person SET accountLocked = :lockedStatus WHERE accountId = :personAccountId").setParameter( "lockedStatus", inRequest.getLockedStatus()).setParameter("personAccountId", inRequest.getPersonAccountId()).executeUpdate(); return true; }  @Override Boolean execute(final SetPersonLockedStatusRequest inRequest);  }