@Test public void testExecute() { final long templateId = 3253L; CompressGadgetZoneRequest request = new CompressGadgetZoneRequest(templateId, 2, null); List<Gadget> results = sut.execute(request); assertEquals(3, results.size()); final long id1 = 3759L; final long id2 = 3751L; final long id3 = 3781L; assertEquals(id1, results.get(0).getId()); assertEquals(id2, results.get(1).getId()); assertEquals(id3, results.get(2).getId()); }
@SuppressWarnings("unchecked") @Override public List<Gadget> execute(final CompressGadgetZoneRequest inRequest) { Query query = getEntityManager() .createQuery( "FROM Gadget WHERE template.id = :tabTemplateId " + "AND zoneNumber = :zoneNumber AND deleted = false ORDER BY zoneIndex") .setParameter("tabTemplateId", inRequest.getTabTemplateId()) .setParameter("zoneNumber", inRequest.getZoneNumber()); return query.getResultList(); }
GetVisibleGadgetsInZone extends BaseArgDomainMapper<CompressGadgetZoneRequest, List<Gadget>> { @SuppressWarnings("unchecked") @Override public List<Gadget> execute(final CompressGadgetZoneRequest inRequest) { Query query = getEntityManager() .createQuery( "FROM Gadget WHERE template.id = :tabTemplateId " + "AND zoneNumber = :zoneNumber AND deleted = false ORDER BY zoneIndex") .setParameter("tabTemplateId", inRequest.getTabTemplateId()) .setParameter("zoneNumber", inRequest.getZoneNumber()); return query.getResultList(); } }
GetVisibleGadgetsInZone extends BaseArgDomainMapper<CompressGadgetZoneRequest, List<Gadget>> { @SuppressWarnings("unchecked") @Override public List<Gadget> execute(final CompressGadgetZoneRequest inRequest) { Query query = getEntityManager() .createQuery( "FROM Gadget WHERE template.id = :tabTemplateId " + "AND zoneNumber = :zoneNumber AND deleted = false ORDER BY zoneIndex") .setParameter("tabTemplateId", inRequest.getTabTemplateId()) .setParameter("zoneNumber", inRequest.getZoneNumber()); return query.getResultList(); }  }
GetVisibleGadgetsInZone extends BaseArgDomainMapper<CompressGadgetZoneRequest, List<Gadget>> { @SuppressWarnings("unchecked") @Override public List<Gadget> execute(final CompressGadgetZoneRequest inRequest) { Query query = getEntityManager() .createQuery( "FROM Gadget WHERE template.id = :tabTemplateId " + "AND zoneNumber = :zoneNumber AND deleted = false ORDER BY zoneIndex") .setParameter("tabTemplateId", inRequest.getTabTemplateId()) .setParameter("zoneNumber", inRequest.getZoneNumber()); return query.getResultList(); }  @SuppressWarnings("unchecked") @Override List<Gadget> execute(final CompressGadgetZoneRequest inRequest); }
GetVisibleGadgetsInZone extends BaseArgDomainMapper<CompressGadgetZoneRequest, List<Gadget>> { @SuppressWarnings("unchecked") @Override public List<Gadget> execute(final CompressGadgetZoneRequest inRequest) { Query query = getEntityManager() .createQuery( "FROM Gadget WHERE template.id = :tabTemplateId " + "AND zoneNumber = :zoneNumber AND deleted = false ORDER BY zoneIndex") .setParameter("tabTemplateId", inRequest.getTabTemplateId()) .setParameter("zoneNumber", inRequest.getZoneNumber()); return query.getResultList(); }  @SuppressWarnings("unchecked") @Override List<Gadget> execute(final CompressGadgetZoneRequest inRequest);  }