/** * This resource method performs automatic projection for the root object entities and manual projection for the * custom metadata. */ @Finder("rootAutomaticMetadataManual") public CollectionResult<Greeting, Greeting> rootAutomaticMetadataManual( final @PagingContextParam PagingContext ctx, final @ProjectionParam MaskTree rootObjectProjection, final @MetadataProjectionParam MaskTree metadataProjection, final @PagingProjectionParam MaskTree pagingProjection) throws CloneNotSupportedException { super.getContext().setMetadataProjectionMode(ProjectionMode.MANUAL); return new CollectionResult<Greeting, Greeting>(LIST, 2, applyMetadataProjection(metadataProjection)); }
/** * This resource method is a variant of the rootAutomaticMetadataManual finder above, except it uses GET_ALL. * This test is to make sure that GET_ALL observes the same code path in restli as FINDER does for projection. * Redundant comments excluded for the sake of brevity. */ @RestMethod.GetAll public CollectionResult<Greeting, Greeting> getAllRootAutomaticMetadataManual( final @PagingContextParam PagingContext ctx, final @ProjectionParam MaskTree rootObjectProjection, final @MetadataProjectionParam MaskTree metadataProjection, final @PagingProjectionParam MaskTree pagingProjection) throws CloneNotSupportedException { super.getContext().setMetadataProjectionMode(ProjectionMode.MANUAL); return new CollectionResult<Greeting, Greeting>(LIST, 2, applyMetadataProjection(metadataProjection)); }
/** * This resource method performs manual projection for the custom metadata and automatic projection * for Paging. */ @Finder("metadataManualPagingFullyAutomatic") public CollectionResult<Greeting, Greeting> metadataManualPagingFullyAutomatic( final @PagingContextParam PagingContext ctx, final @ProjectionParam MaskTree rootObjectProjection, final @MetadataProjectionParam MaskTree metadataProjection, final @PagingProjectionParam MaskTree pagingProjection) throws CloneNotSupportedException { super.getContext().setMetadataProjectionMode(ProjectionMode.MANUAL); return new CollectionResult<Greeting, Greeting>(LIST, 2, applyMetadataProjection(metadataProjection)); }
/** * Same as the test above except that this test is to make sure that GET_ALL observes the same code path in * restli as FINDER does for custom metadata and paging projection. * Redundant comments excluded for the sake of brevity. */ @RestMethod.GetAll public CollectionResult<Greeting, Greeting> getAllMetadataManualPagingAutomaticPartialNull( final @PagingContextParam PagingContext ctx, final @ProjectionParam MaskTree rootObjectProjection, final @MetadataProjectionParam MaskTree metadataProjection, final @PagingProjectionParam MaskTree pagingProjection) throws CloneNotSupportedException { super.getContext().setMetadataProjectionMode(ProjectionMode.MANUAL); return new CollectionResult<Greeting, Greeting>(LIST, calculateTotal(pagingProjection), applyMetadataProjection(metadataProjection)); }
/** * This resource method performs manual projection for the custom metadata and automatic projection * for paging. This particular resource method also varies on what it sets total to. * Comments excluded since its combining behavior from the previous tests. */ @Finder("metadataManualPagingAutomaticPartialNull") public CollectionResult<Greeting, Greeting> metadataManualPagingAutomaticPartialNull( final @PagingContextParam PagingContext ctx, final @ProjectionParam MaskTree rootObjectProjection, final @MetadataProjectionParam MaskTree metadataProjection, final @PagingProjectionParam MaskTree pagingProjection) throws CloneNotSupportedException { super.getContext().setMetadataProjectionMode(ProjectionMode.MANUAL); return new CollectionResult<Greeting, Greeting>(LIST, calculateTotal(pagingProjection), applyMetadataProjection(metadataProjection)); }
/** * This resource method performs manual projection for the root object entities and manual projection for the * custom metadata. Comments excluded since its combining behavior from the previous tests. */ @Finder("rootManualMetadataManual") public CollectionResult<Greeting, Greeting> rootManualMetadataManual( final @PagingContextParam PagingContext ctx, final @ProjectionParam MaskTree rootObjectProjection, final @MetadataProjectionParam MaskTree metadataProjection, final @PagingProjectionParam MaskTree pagingProjection) throws CloneNotSupportedException { super.getContext().setMetadataProjectionMode(ProjectionMode.MANUAL); super.getContext().setProjectionMode(ProjectionMode.MANUAL); return new CollectionResult<Greeting, Greeting>(applyRootObjectProjection(rootObjectProjection), 2, applyMetadataProjection(metadataProjection)); }