@Test public void testGadgetDefinition() { Tab fordTab1 = jpaTabMapper.findById(fordsFirstTabId); final Gadget g = fordTab1.getGadgets().get(0); afterTransactionAction = new PostTransactionAction() { @Override public void execute() { assertNotNull(g); junit.framework.Assert.assertEquals("http: .getUrl()); } }; }
public Tab findById(final Long tabId) { Query q = entityManager.createQuery( "from Tab t left join fetch t.template where t.id = :tabId and t.deleted = 'false'").setParameter( "tabId", tabId); Tab tab = (Tab) q.getSingleResult(); tab.getGadgets().size(); return tab; }
TabMapper { public Tab findById(final Long tabId) { Query q = entityManager.createQuery( "from Tab t left join fetch t.template where t.id = :tabId and t.deleted = 'false'").setParameter( "tabId", tabId); Tab tab = (Tab) q.getSingleResult(); tab.getGadgets().size(); return tab; } }
TabMapper { public Tab findById(final Long tabId) { Query q = entityManager.createQuery( "from Tab t left join fetch t.template where t.id = :tabId and t.deleted = 'false'").setParameter( "tabId", tabId); Tab tab = (Tab) q.getSingleResult(); tab.getGadgets().size(); return tab; } TabMapper(final QueryOptimizer inQueryOptimizer); }
TabMapper { public Tab findById(final Long tabId) { Query q = entityManager.createQuery( "from Tab t left join fetch t.template where t.id = :tabId and t.deleted = 'false'").setParameter( "tabId", tabId); Tab tab = (Tab) q.getSingleResult(); tab.getGadgets().size(); return tab; } TabMapper(final QueryOptimizer inQueryOptimizer); TabTemplate getTabTemplate(final String type); void setUndeleteGadgetWindowInMinutes(final int undeleteWindowInMinutes); @PersistenceContext void setEntityManager(final EntityManager inEntityManager); Tab findById(final Long tabId); TabTemplate findByGadgetId(final Long gadgetId); Tab findTabByGadgetId(final Long gadgetId); Tab findById(final Integer tabId); void flush(); void deleteGadget(final Gadget gadgetToDelete); Gadget undeleteGadget(final long gadgetId); @SuppressWarnings("unchecked") void moveGadget(final Long gadgetId, final Long sourceTabTemplateId, final Integer sourceZoneIndex,
            final Integer sourceZoneNumber, final Long targetTabTemplateId, final Integer targetZoneIndex,
            final Integer targetZoneNumber); }
TabMapper { public Tab findById(final Long tabId) { Query q = entityManager.createQuery( "from Tab t left join fetch t.template where t.id = :tabId and t.deleted = 'false'").setParameter( "tabId", tabId); Tab tab = (Tab) q.getSingleResult(); tab.getGadgets().size(); return tab; } TabMapper(final QueryOptimizer inQueryOptimizer); TabTemplate getTabTemplate(final String type); void setUndeleteGadgetWindowInMinutes(final int undeleteWindowInMinutes); @PersistenceContext void setEntityManager(final EntityManager inEntityManager); Tab findById(final Long tabId); TabTemplate findByGadgetId(final Long gadgetId); Tab findTabByGadgetId(final Long gadgetId); Tab findById(final Integer tabId); void flush(); void deleteGadget(final Gadget gadgetToDelete); Gadget undeleteGadget(final long gadgetId); @SuppressWarnings("unchecked") void moveGadget(final Long gadgetId, final Long sourceTabTemplateId, final Integer sourceZoneIndex,
            final Integer sourceZoneNumber, final Long targetTabTemplateId, final Integer targetZoneIndex,
            final Integer targetZoneNumber);  }