@Test public void testExecuteMultipleRows() { final long id = 1831L; final long template1 = 1097L; final long person1 = 4507L; final long template2 = 1097L; final long person2 = 98L; final long template3 = 3253L; final long person3 = 98L; Collection<CompressGadgetZoneRequest> list = sut.execute(id); assertEquals(3, list.size()); CompressGadgetZoneRequest expected = new CompressGadgetZoneRequest(template1, 0, person1); assertTrue(Matchers.hasItem(equalInternally(expected)).matches(list)); expected = new CompressGadgetZoneRequest(template2, 0, person2); assertTrue(Matchers.hasItem(equalInternally(expected)).matches(list)); expected = new CompressGadgetZoneRequest(template3, 0, person3); assertTrue(Matchers.hasItem(equalInternally(expected)).matches(list)); }
@SuppressWarnings("unchecked") @Override public Collection<CompressGadgetZoneRequest> execute(final Long inRequest) { Query query = getEntityManager().createQuery( "SELECT NEW org.eurekastreams.server.action.request.gallery.CompressGadgetZoneRequest" + "(template.id,zoneNumber,owner.id) FROM Gadget " + "WHERE gadgetDefinition.id = :gadgetDefinitionId") .setParameter("gadgetDefinitionId", inRequest); return query.getResultList(); }
GetZonesToCompressForGadgetDefinition extends
        BaseArgDomainMapper<Long, Collection<CompressGadgetZoneRequest>> { @SuppressWarnings("unchecked") @Override public Collection<CompressGadgetZoneRequest> execute(final Long inRequest) { Query query = getEntityManager().createQuery( "SELECT NEW org.eurekastreams.server.action.request.gallery.CompressGadgetZoneRequest" + "(template.id,zoneNumber,owner.id) FROM Gadget " + "WHERE gadgetDefinition.id = :gadgetDefinitionId") .setParameter("gadgetDefinitionId", inRequest); return query.getResultList(); } }
GetZonesToCompressForGadgetDefinition extends
        BaseArgDomainMapper<Long, Collection<CompressGadgetZoneRequest>> { @SuppressWarnings("unchecked") @Override public Collection<CompressGadgetZoneRequest> execute(final Long inRequest) { Query query = getEntityManager().createQuery( "SELECT NEW org.eurekastreams.server.action.request.gallery.CompressGadgetZoneRequest" + "(template.id,zoneNumber,owner.id) FROM Gadget " + "WHERE gadgetDefinition.id = :gadgetDefinitionId") .setParameter("gadgetDefinitionId", inRequest); return query.getResultList(); }  }
GetZonesToCompressForGadgetDefinition extends
        BaseArgDomainMapper<Long, Collection<CompressGadgetZoneRequest>> { @SuppressWarnings("unchecked") @Override public Collection<CompressGadgetZoneRequest> execute(final Long inRequest) { Query query = getEntityManager().createQuery( "SELECT NEW org.eurekastreams.server.action.request.gallery.CompressGadgetZoneRequest" + "(template.id,zoneNumber,owner.id) FROM Gadget " + "WHERE gadgetDefinition.id = :gadgetDefinitionId") .setParameter("gadgetDefinitionId", inRequest); return query.getResultList(); }  @SuppressWarnings("unchecked") @Override Collection<CompressGadgetZoneRequest> execute(final Long inRequest); }
GetZonesToCompressForGadgetDefinition extends
        BaseArgDomainMapper<Long, Collection<CompressGadgetZoneRequest>> { @SuppressWarnings("unchecked") @Override public Collection<CompressGadgetZoneRequest> execute(final Long inRequest) { Query query = getEntityManager().createQuery( "SELECT NEW org.eurekastreams.server.action.request.gallery.CompressGadgetZoneRequest" + "(template.id,zoneNumber,owner.id) FROM Gadget " + "WHERE gadgetDefinition.id = :gadgetDefinitionId") .setParameter("gadgetDefinitionId", inRequest); return query.getResultList(); }  @SuppressWarnings("unchecked") @Override Collection<CompressGadgetZoneRequest> execute(final Long inRequest);  }