@Test public void testExecute() { final long id1 = 42L; final long id2 = 142L; GetSystemAdministratorIdsDbMapper sut = new GetSystemAdministratorIdsDbMapper(); sut.setEntityManager(getEntityManager()); List<Long> admins = sut.execute(null); Assert.assertEquals(2, admins.size()); Assert.assertTrue(admins.contains(id1)); Assert.assertTrue(admins.contains(id2)); }
@Override public List<Long> execute(final Serializable ignored) { return getEntityManager().createQuery("SELECT id FROM Person WHERE isAdministrator = :true").setParameter( "true", true).getResultList(); }
GetSystemAdministratorIdsDbMapper extends BaseArgDomainMapper<Serializable, List<Long>> { @Override public List<Long> execute(final Serializable ignored) { return getEntityManager().createQuery("SELECT id FROM Person WHERE isAdministrator = :true").setParameter( "true", true).getResultList(); } }
GetSystemAdministratorIdsDbMapper extends BaseArgDomainMapper<Serializable, List<Long>> { @Override public List<Long> execute(final Serializable ignored) { return getEntityManager().createQuery("SELECT id FROM Person WHERE isAdministrator = :true").setParameter( "true", true).getResultList(); }  }
GetSystemAdministratorIdsDbMapper extends BaseArgDomainMapper<Serializable, List<Long>> { @Override public List<Long> execute(final Serializable ignored) { return getEntityManager().createQuery("SELECT id FROM Person WHERE isAdministrator = :true").setParameter( "true", true).getResultList(); }  @Override List<Long> execute(final Serializable ignored); }
GetSystemAdministratorIdsDbMapper extends BaseArgDomainMapper<Serializable, List<Long>> { @Override public List<Long> execute(final Serializable ignored) { return getEntityManager().createQuery("SELECT id FROM Person WHERE isAdministrator = :true").setParameter( "true", true).getResultList(); }  @Override List<Long> execute(final Serializable ignored);  }