@Test public void testMergeAttributesAndRelationships() { AgEntity<X> entity = metadataService.getAgEntity(X.class); ResourceEntity<X> root = new RootResourceEntity<>(entity, null); includeMerger.merge(root, asList(new Include("name"), new Include("ys")), Collections.emptyMap()); assertEquals(1, root.getAttributes().size()); assertFalse(root.isIdIncluded()); assertEquals(1, root.getChildren().size()); }
@Override public void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays) { PhantomTrackingResourceEntityTreeBuilder treeBuilder = new PhantomTrackingResourceEntityTreeBuilder(entity, metadataService::getAgEntity, overlays); for (Include include : includes) { mergeInclude(entity, include, treeBuilder, overlays); } for (ResourceEntity<?> e : treeBuilder.nonPhantomEntities()) { processDefaultIncludes(e); } }
IncludeMerger implements IIncludeMerger { @Override public void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays) { PhantomTrackingResourceEntityTreeBuilder treeBuilder = new PhantomTrackingResourceEntityTreeBuilder(entity, metadataService::getAgEntity, overlays); for (Include include : includes) { mergeInclude(entity, include, treeBuilder, overlays); } for (ResourceEntity<?> e : treeBuilder.nonPhantomEntities()) { processDefaultIncludes(e); } } }
IncludeMerger implements IIncludeMerger { @Override public void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays) { PhantomTrackingResourceEntityTreeBuilder treeBuilder = new PhantomTrackingResourceEntityTreeBuilder(entity, metadataService::getAgEntity, overlays); for (Include include : includes) { mergeInclude(entity, include, treeBuilder, overlays); } for (ResourceEntity<?> e : treeBuilder.nonPhantomEntities()) { processDefaultIncludes(e); } } IncludeMerger(
            @Inject IMetadataService metadataService,
            @Inject ICayenneExpMerger expMerger,
            @Inject ISortMerger sortMerger,
            @Inject IMapByMerger mapByMerger,
            @Inject ISizeMerger sizeMerger); }
IncludeMerger implements IIncludeMerger { @Override public void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays) { PhantomTrackingResourceEntityTreeBuilder treeBuilder = new PhantomTrackingResourceEntityTreeBuilder(entity, metadataService::getAgEntity, overlays); for (Include include : includes) { mergeInclude(entity, include, treeBuilder, overlays); } for (ResourceEntity<?> e : treeBuilder.nonPhantomEntities()) { processDefaultIncludes(e); } } IncludeMerger(
            @Inject IMetadataService metadataService,
            @Inject ICayenneExpMerger expMerger,
            @Inject ISortMerger sortMerger,
            @Inject IMapByMerger mapByMerger,
            @Inject ISizeMerger sizeMerger); static void checkTooLong(String path); @Override void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays); }
IncludeMerger implements IIncludeMerger { @Override public void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays) { PhantomTrackingResourceEntityTreeBuilder treeBuilder = new PhantomTrackingResourceEntityTreeBuilder(entity, metadataService::getAgEntity, overlays); for (Include include : includes) { mergeInclude(entity, include, treeBuilder, overlays); } for (ResourceEntity<?> e : treeBuilder.nonPhantomEntities()) { processDefaultIncludes(e); } } IncludeMerger(
            @Inject IMetadataService metadataService,
            @Inject ICayenneExpMerger expMerger,
            @Inject ISortMerger sortMerger,
            @Inject IMapByMerger mapByMerger,
            @Inject ISizeMerger sizeMerger); static void checkTooLong(String path); @Override void merge(ResourceEntity<?> entity, List<Include> includes, Map<Class<?>, AgEntityOverlay<?>> overlays);  }