@Test public void testGetResultWithComplexContainingCollection() throws ODataJPAModelException, ODataApplicationException { createCutGetResultEntityWithComplexWithCollection(); final Map<JPAAssociationPath, JPAExpandResult> act = cut.getChildren(); boolean found = false; assertDoesNotContain(cut.getResult("root"), "Complex/Address"); assertNotNull(act); assertFalse(act.isEmpty()); for (Entry<JPAAssociationPath, JPAExpandResult> entity : act.entrySet()) { if (entity.getKey().getAlias().equals("Complex/Address")) { found = true; assertEquals(1, entity.getValue().getResults().size()); assertEquals("Complex/Address", entity.getKey().getAlias()); final Collection<Object> actConverted = ((JPACollectionResult) entity.getValue()).getPropertyCollection( JPAExpandResult.ROOT_RESULT_KEY); assertEquals(2, actConverted.size()); for (Object o : actConverted) { assertNotNull(o); assertFalse(((ComplexValue) o).getValue().isEmpty()); } } } assertTrue(found); }
@Override public Map<JPAAssociationPath, JPAExpandResult> getChildren() { return children; }
JPACreateResult implements JPAExpandResult { @Override public Map<JPAAssociationPath, JPAExpandResult> getChildren() { return children; } }
JPACreateResult implements JPAExpandResult { @Override public Map<JPAAssociationPath, JPAExpandResult> getChildren() { return children; } JPACreateResult(final JPAEntityType et, final Map<String, List<String>> requestHeaders); }
JPACreateResult implements JPAExpandResult { @Override public Map<JPAAssociationPath, JPAExpandResult> getChildren() { return children; } JPACreateResult(final JPAEntityType et, final Map<String, List<String>> requestHeaders); @Override void convert(final JPATupleChildConverter converter); @Override JPAExpandResult getChild(JPAAssociationPath associationPath); @Override Map<JPAAssociationPath, JPAExpandResult> getChildren(); @Override Long getCount(final String key); @Override JPAEntityType getEntityType(); @Override boolean hasCount(); }
JPACreateResult implements JPAExpandResult { @Override public Map<JPAAssociationPath, JPAExpandResult> getChildren() { return children; } JPACreateResult(final JPAEntityType et, final Map<String, List<String>> requestHeaders); @Override void convert(final JPATupleChildConverter converter); @Override JPAExpandResult getChild(JPAAssociationPath associationPath); @Override Map<JPAAssociationPath, JPAExpandResult> getChildren(); @Override Long getCount(final String key); @Override JPAEntityType getEntityType(); @Override boolean hasCount();  }