@Test public void readMultipleEntityFunctionImport() throws Exception { final EdmFunctionImport functionImport = MockFacade.getMockEdm().getDefaultEntityContainer() .getFunctionImport("EmployeeSearch"); InputStream content = new ByteArrayInputStream( ("{\"d\": {" + "\"results\": [{" + "\"__metadata\": {" + "\"type\": \"RefScenario.Employee\"," + "\"content_type\": \"image/jpeg\"," + "\"media_src\":\"http: + "\"edit_media\":\"http: + "}," + "\"EmployeeId\": \"3\"," + "\"EmployeeName\": \"Jonathan Smith\"," + "\"ManagerId\": \"1\"," + "\"RoomId\": \"2\"," + "\"TeamId\": \"1\"," + "\"Location\": {" + "\"__metadata\": {" + "\"type\": \"RefScenario.c_Location\"" + "}," + "\"City\": {" + "\"__metadata\": {" + "\"type\": \"RefScenario.c_City\"" + "}," + "\"PostalCode\": \"69190\"," + "\"CityName\": \"Walldorf\"" + "}," + "\"Country\": \"Germany\"" + "}," + "\"Age\": 56," + "\"EntryDate\": null," + "\"ImageUrl\": \"Employees('3')/$value\"," + "\"ne_Manager\": {" + "\"__deferred\": {" + "\"uri\": \"http: + "}" + "}," + "\"ne_Team\": {" + "\"__deferred\": {" + "\"uri\": \"http: + "}" + "}," + "\"ne_Room\": {" + "\"__deferred\": {" + "\"uri\": \"http: + "}" + "}" + "}]" + "}" + "}").getBytes("UTF-8")); final Object result = new ProviderFacadeImpl().readFunctionImport(HttpContentType.APPLICATION_JSON, functionImport, content, EntityProviderReadProperties.init().build()); ODataDeltaFeed feed = (ODataDeltaFeed) result; List<ODataEntry> entries = feed.getEntries(); int size = entries.size(); assertEquals(1, size); String id = (String) entries.get(0).getProperties().get("EmployeeId"); assertEquals("3", id); }
@Override public Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { return create(contentType).readFunctionImport(functionImport, content, properties); }
ProviderFacadeImpl implements EntityProviderInterface { @Override public Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { return create(contentType).readFunctionImport(functionImport, content, properties); } }
ProviderFacadeImpl implements EntityProviderInterface { @Override public Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { return create(contentType).readFunctionImport(functionImport, content, properties); }  }
ProviderFacadeImpl implements EntityProviderInterface { @Override public Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { return create(contentType).readFunctionImport(functionImport, content, properties); }  @Override ODataResponse writeErrorDocument(final ODataErrorContext context); @Override ODataResponse writeServiceDocument(final String contentType, final Edm edm, final String serviceRoot); @Override ODataResponse writePropertyValue(final EdmProperty edmProperty, final Object value); @Override ODataResponse writeText(final String value); @Override ODataResponse writeBinary(final String mimeType, final byte[] data); @Override ODataResponse writeFeed(final String contentType, final EdmEntitySet entitySet,
      final List<Map<String, Object>> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeEntry(final String contentType, final EdmEntitySet entitySet,
      final Map<String, Object> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeProperty(final String contentType, final EdmProperty edmProperty, final Object value); @Override ODataResponse writeLink(final String contentType, final EdmEntitySet entitySet,
      final Map<String, Object> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeLinks(final String contentType, final EdmEntitySet entitySet,
      final List<Map<String, Object>> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeFunctionImport(final String contentType, final EdmFunctionImport functionImport,
      final Object data, final EntityProviderWriteProperties properties); @Override ODataErrorContext readErrorDocument(final InputStream errorDocument, final String contentType); @Override ODataFeed readFeed(final String contentType, final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); @Override ODataDeltaFeed readDeltaFeed(final String contentType, final EdmEntitySet entitySet,
      final InputStream content,
      final EntityProviderReadProperties properties); @Override ODataEntry readEntry(final String contentType, final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); @Override Map<String, Object> readProperty(final String contentType, final EdmProperty edmProperty,
      final InputStream content, final EntityProviderReadProperties properties); @Override Object readPropertyValue(final EdmProperty edmProperty, final InputStream content, final Class<?> typeMapping); @Override Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport,
      final InputStream content, final EntityProviderReadProperties properties); @Override List<String> readLinks(final String contentType, final EdmEntitySet entitySet, final InputStream content); @Override String readLink(final String contentType, final EdmEntitySet entitySet, final InputStream content); @Override byte[] readBinary(final InputStream content); @Override ODataResponse writeMetadata(final List<Schema> schemas, final Map<String, String> predefinedNamespaces); @Override ODataResponse writeMetadata(final DataServices seriviceMetadata,
      final Map<String, String> predefinedNamespaces); @Override Edm readMetadata(final InputStream inputStream, final boolean validate); @Override ServiceDocument readServiceDocument(final InputStream serviceDocument, final String contentType); @Override List<BatchRequestPart> parseBatchRequest(final String contentType, final InputStream content,
      final EntityProviderBatchProperties properties); @Override ODataResponse writeBatchResponse(final List<BatchResponsePart> batchResponseParts); @Override InputStream writeBatchRequest(final List<BatchPart> batchParts, final String boundary); @Override List<BatchSingleResponse> parseBatchResponse(final String contentType, final InputStream content); }
ProviderFacadeImpl implements EntityProviderInterface { @Override public Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { return create(contentType).readFunctionImport(functionImport, content, properties); }  @Override ODataResponse writeErrorDocument(final ODataErrorContext context); @Override ODataResponse writeServiceDocument(final String contentType, final Edm edm, final String serviceRoot); @Override ODataResponse writePropertyValue(final EdmProperty edmProperty, final Object value); @Override ODataResponse writeText(final String value); @Override ODataResponse writeBinary(final String mimeType, final byte[] data); @Override ODataResponse writeFeed(final String contentType, final EdmEntitySet entitySet,
      final List<Map<String, Object>> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeEntry(final String contentType, final EdmEntitySet entitySet,
      final Map<String, Object> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeProperty(final String contentType, final EdmProperty edmProperty, final Object value); @Override ODataResponse writeLink(final String contentType, final EdmEntitySet entitySet,
      final Map<String, Object> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeLinks(final String contentType, final EdmEntitySet entitySet,
      final List<Map<String, Object>> data, final EntityProviderWriteProperties properties); @Override ODataResponse writeFunctionImport(final String contentType, final EdmFunctionImport functionImport,
      final Object data, final EntityProviderWriteProperties properties); @Override ODataErrorContext readErrorDocument(final InputStream errorDocument, final String contentType); @Override ODataFeed readFeed(final String contentType, final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); @Override ODataDeltaFeed readDeltaFeed(final String contentType, final EdmEntitySet entitySet,
      final InputStream content,
      final EntityProviderReadProperties properties); @Override ODataEntry readEntry(final String contentType, final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); @Override Map<String, Object> readProperty(final String contentType, final EdmProperty edmProperty,
      final InputStream content, final EntityProviderReadProperties properties); @Override Object readPropertyValue(final EdmProperty edmProperty, final InputStream content, final Class<?> typeMapping); @Override Object readFunctionImport(final String contentType, final EdmFunctionImport functionImport,
      final InputStream content, final EntityProviderReadProperties properties); @Override List<String> readLinks(final String contentType, final EdmEntitySet entitySet, final InputStream content); @Override String readLink(final String contentType, final EdmEntitySet entitySet, final InputStream content); @Override byte[] readBinary(final InputStream content); @Override ODataResponse writeMetadata(final List<Schema> schemas, final Map<String, String> predefinedNamespaces); @Override ODataResponse writeMetadata(final DataServices seriviceMetadata,
      final Map<String, String> predefinedNamespaces); @Override Edm readMetadata(final InputStream inputStream, final boolean validate); @Override ServiceDocument readServiceDocument(final InputStream serviceDocument, final String contentType); @Override List<BatchRequestPart> parseBatchRequest(final String contentType, final InputStream content,
      final EntityProviderBatchProperties properties); @Override ODataResponse writeBatchResponse(final List<BatchResponsePart> batchResponseParts); @Override InputStream writeBatchRequest(final List<BatchPart> batchParts, final String boundary); @Override List<BatchSingleResponse> parseBatchResponse(final String contentType, final InputStream content);  }