@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(); assertEquals(total, sut.execute(false).size()); assertEquals(0, sut.execute(true).size()); getEntityManager().createQuery("UPDATE Person SET accountLocked = true").executeUpdate(); assertEquals(total, sut.execute(true).size()); assertEquals(0, sut.execute(false).size()); }
@SuppressWarnings("unchecked") @Override public List<Long> execute(final Boolean inLockedStatus) { return getEntityManager().createQuery("SELECT id FROM Person WHERE accountLocked = :lockedStatus") .setParameter("lockedStatus", inLockedStatus).getResultList(); }
GetPersonIdsByLockedStatus extends BaseArgDomainMapper<Boolean, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Boolean inLockedStatus) { return getEntityManager().createQuery("SELECT id FROM Person WHERE accountLocked = :lockedStatus") .setParameter("lockedStatus", inLockedStatus).getResultList(); } }
GetPersonIdsByLockedStatus extends BaseArgDomainMapper<Boolean, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Boolean inLockedStatus) { return getEntityManager().createQuery("SELECT id FROM Person WHERE accountLocked = :lockedStatus") .setParameter("lockedStatus", inLockedStatus).getResultList(); }  }
GetPersonIdsByLockedStatus extends BaseArgDomainMapper<Boolean, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Boolean inLockedStatus) { return getEntityManager().createQuery("SELECT id FROM Person WHERE accountLocked = :lockedStatus") .setParameter("lockedStatus", inLockedStatus).getResultList(); }  @SuppressWarnings("unchecked") @Override List<Long> execute(final Boolean inLockedStatus); }
GetPersonIdsByLockedStatus extends BaseArgDomainMapper<Boolean, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Boolean inLockedStatus) { return getEntityManager().createQuery("SELECT id FROM Person WHERE accountLocked = :lockedStatus") .setParameter("lockedStatus", inLockedStatus).getResultList(); }  @SuppressWarnings("unchecked") @Override List<Long> execute(final Boolean inLockedStatus);  }