@Test public void testDirectReferenceQueryPlan() { List<String> ids = new ArrayList<String>(); ids.add(section1.getEntityId()); ids.add(section2.getEntityId()); NeutralQuery constraint = new NeutralQuery(); constraint.addCriteria(new NeutralCriteria("_id", NeutralCriteria.CRITERIA_IN, ids)); List<EntityBody> results = defaultSelectorDocument.aggregate(createQueryPlan("Section", getDirectRefQueryPlan()), constraint); assertNotNull("Should not be null", results); assertEquals("Should match", 2, results.size()); EntityBody section = results.get(0); assertTrue("Should be true", section.containsKey("sessions")); @SuppressWarnings("unchecked") List<EntityBody> sessionList = (List<EntityBody>) section.get("sessions"); assertEquals("Should match", 1, sessionList.size()); EntityBody session = sessionList.get(0); assertTrue("Should be true", session.containsKey("sessionName")); }
@Override public List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint) { return executeQueryPlan(selectorQuery, constraint, new ArrayList<EntityBody>(), new Stack<Type>(), true, new MyCounter()); }
DefaultSelectorDocument implements SelectorDocument { @Override public List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint) { return executeQueryPlan(selectorQuery, constraint, new ArrayList<EntityBody>(), new Stack<Type>(), true, new MyCounter()); } }
DefaultSelectorDocument implements SelectorDocument { @Override public List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint) { return executeQueryPlan(selectorQuery, constraint, new ArrayList<EntityBody>(), new Stack<Type>(), true, new MyCounter()); }  }
DefaultSelectorDocument implements SelectorDocument { @Override public List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint) { return executeQueryPlan(selectorQuery, constraint, new ArrayList<EntityBody>(), new Stack<Type>(), true, new MyCounter()); }  @Override List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint); List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value); }
DefaultSelectorDocument implements SelectorDocument { @Override public List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint) { return executeQueryPlan(selectorQuery, constraint, new ArrayList<EntityBody>(), new Stack<Type>(), true, new MyCounter()); }  @Override List<EntityBody> aggregate(SelectorQuery selectorQuery, final NeutralQuery constraint); List<EntityBody> getEntitySubList(List<EntityBody> list, String field, String value); static final int EMBEDDED_DOCUMENT_LIMIT; }