You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ra...@apache.org on 2020/12/09 05:20:14 UTC
[olingo-odata2] branch master updated: [OLINGO-1497]System Query
options no longer working for Function Imports
This is an automated email from the ASF dual-hosted git repository.
ramyav pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git
The following commit(s) were added to refs/heads/master by this push:
new b81c987 [OLINGO-1497]System Query options no longer working for Function Imports
b81c987 is described below
commit b81c987faab99704e49ced83d74d7a69daee2fb4
Author: ramya vasanth <ra...@sap.com>
AuthorDate: Wed Dec 9 10:50:03 2020 +0530
[OLINGO-1497]System Query options no longer working for Function Imports
---
.../org/apache/olingo/odata2/client/core/uri/UriParserTest.java | 8 ++++++++
.../src/main/java/org/apache/olingo/odata2/core/uri/UriType.java | 4 +++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/uri/UriParserTest.java b/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/uri/UriParserTest.java
index 21394c1..c654e62 100644
--- a/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/uri/UriParserTest.java
+++ b/odata2-lib/odata-client-core/src/test/java/org/apache/olingo/odata2/client/core/uri/UriParserTest.java
@@ -40,6 +40,7 @@ import org.apache.olingo.odata2.api.commons.InlineCount;
import org.apache.olingo.odata2.api.edm.Edm;
import org.apache.olingo.odata2.api.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
import org.apache.olingo.odata2.api.edm.EdmTypeKind;
import org.apache.olingo.odata2.api.exception.MessageReference;
@@ -688,6 +689,7 @@ public class UriParserTest {
parseWrongUri("MaximalAge/somethingwrong", UriSyntaxException.INVALIDSEGMENT);
parseWrongUri("ManagerPhoto", UriSyntaxException.MISSINGPARAMETER);
parseWrongUri("ManagerPhoto?Id='", UriSyntaxException.UNKNOWNLITERAL);
+ parseWrongUri("OldestEmployee?$filter=EmployeeId%20eq%20%271%27", UriSyntaxException.INCOMPATIBLESYSTEMQUERYOPTION);
}
@Test
@@ -768,6 +770,12 @@ public class UriParserTest {
assertNotNull(result.getFilter());
assertNotNull(result.getOrderBy());
assertEquals("EmployeeName desc", result.getOrderBy().getUriLiteral());
+
+ result = parse("EmployeeSearch?$filter=EmployeeId%20eq%20%271%27");
+ assertEquals("Employee", result.getFunctionImport().getReturnType().getType().getName());
+ assertEquals(EdmMultiplicity.MANY, result.getFunctionImport().getReturnType().getMultiplicity());
+ assertEquals(UriType.URI10a, result.getUriType());
+ assertNotNull(result.getFilter());
}
@Test(expected=UriSyntaxException.class)
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriType.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriType.java
index 3a0772f..9827c11 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriType.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriType.java
@@ -84,7 +84,9 @@ public enum UriType {
/**
* Function import returning an entity set
*/
- URI10a(SystemQueryOption.$format),
+ URI10a(SystemQueryOption.$format, SystemQueryOption.$filter, SystemQueryOption.$inlinecount,
+ SystemQueryOption.$orderby, SystemQueryOption.$skiptoken, SystemQueryOption.$skip, SystemQueryOption.$top,
+ SystemQueryOption.$expand, SystemQueryOption.$select),
/**
* Function import returning a collection of complex-type instances
*/