You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2016/08/17 12:02:42 UTC
olingo-odata4 git commit: [OLINGO-1004] edited edm for consistency
Repository: olingo-odata4
Updated Branches:
refs/heads/master 37a1e110c -> fd2592d4e
[OLINGO-1004] edited edm for consistency
added new entity types, entity sets, actions and functions to test overloading and default values, tests are not implemented yet.
Signed-off-by: Christian Amend <ch...@sap.com>
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/fd2592d4
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/fd2592d4
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/fd2592d4
Branch: refs/heads/master
Commit: fd2592d4e28e6b85e97be60d36acd9e8f8163d45
Parents: 37a1e11
Author: Morten Riedel <Mo...@sap.com>
Authored: Wed Aug 17 09:40:26 2016 +0200
Committer: Christian Amend <ch...@sap.com>
Committed: Wed Aug 17 14:01:39 2016 +0200
----------------------------------------------------------------------
.../olingo/server/tecsvc/data/ActionData.java | 7 +
.../server/tecsvc/provider/ActionProvider.java | 130 ++++++++++++-
.../tecsvc/provider/ContainerProvider.java | 51 ++++-
.../tecsvc/provider/EntityTypeProvider.java | 30 ++-
.../tecsvc/provider/FunctionProvider.java | 184 ++++++++++++++++++-
.../tecsvc/provider/PropertyProvider.java | 112 ++++++++++-
.../server/tecsvc/provider/SchemaProvider.java | 19 +-
.../json/ODataJsonSerializerTest.java | 58 +++++-
.../serializer/xml/ODataXmlSerializerTest.java | 101 +++++++++-
9 files changed, 666 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/ActionData.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/ActionData.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/ActionData.java
index 51f51c8..1b3e1f4 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/ActionData.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/ActionData.java
@@ -55,6 +55,13 @@ public class ActionData {
return DataCreator.createPrimitive(null, "UARTString string value");
} else if ("UARTByteNineParam".equals(name)) {
return FunctionData.primitiveComplexFunction("UFNRTByteNineParam", parameters, null);
+ }else if("_A_RTTimeOfDay_".equals(name)){
+ Parameter paramTimeOfDay = parameters.get("ParameterTimeOfDay");
+ Calendar timeOfDay = Calendar.getInstance();
+ if (paramTimeOfDay != null && !paramTimeOfDay.isNull()) {
+ timeOfDay = (Calendar) paramTimeOfDay.asPrimitive();
+ }
+ return DataCreator.createPrimitive("ParameterTimeOfDay", timeOfDay);
}
throw new DataProviderException("Action " + name + " is not yet implemented.",
HttpStatusCode.NOT_IMPLEMENTED);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
index e7ec643..4f1559c 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
@@ -55,7 +55,29 @@ public class ActionProvider {
public static final FullQualifiedName nameBAETAllPrimRT =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETAllPrimRT");
-
+
+ public static final FullQualifiedName nameBAETTwoPrimRTString =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoPrimRTString");
+
+ public static final FullQualifiedName nameBAETTwoPrimRTCollString =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoPrimRTCollString");
+
+ public static final FullQualifiedName nameBAETTwoPrimRTCTAllPrim =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoPrimRTCTAllPrim");
+
+ public static final FullQualifiedName nameBAETTwoPrimRTCollCTAllPrim =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoPrimRTCollCTAllPrim");
+
+ public static final FullQualifiedName nameBAETCompAllPrimRTETCompAllPrim =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETCompAllPrimRTETCompAllPrim");
+
+ public static final FullQualifiedName nameBAETTwoKeyNavRTETTwoKeyNavParam =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoKeyNavRTETTwoKeyNavParam");
+
+ // Unknown Actions
+ public static final FullQualifiedName name_A_RTTimeOfDay_ =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "_A_RTTimeOfDay_");
+
// Unbound Actions
public static final FullQualifiedName nameUARTString = new FullQualifiedName(SchemaProvider.NAMESPACE,
"UARTString");
@@ -84,8 +106,10 @@ public class ActionProvider {
public static List<CsdlAction> getBoundActionsForEntityType(FullQualifiedName entityType) throws ODataException {
FullQualifiedName[] actionNames = {nameBAESAllPrimRTETAllPrim,
nameBAESTwoKeyNavRTESTwoKeyNav, nameBAESTwoKeyNavRTESKeyNav, nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav,
- nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav,nameBA_RTETTwoKeyNav,
- nameBAESAllPrimRT,nameBAETAllPrimRT};
+ nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav, nameBA_RTETTwoKeyNav,nameBAESAllPrimRT,
+ nameBAETAllPrimRT, nameBAETTwoPrimRTString, nameBAETTwoPrimRTCollString, nameBAETTwoPrimRTCTAllPrim,
+ nameBAETTwoPrimRTCollCTAllPrim, nameBAETCompAllPrimRTETCompAllPrim, nameBAETTwoKeyNavRTETTwoKeyNavParam,
+ name_A_RTTimeOfDay_ };
List<CsdlAction> actions = new ArrayList<CsdlAction>();
for (FullQualifiedName fqn:actionNames) {
@@ -101,7 +125,39 @@ public class ActionProvider {
}
public static List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException {
- if (actionName.equals(nameUARTString)) {
+
+ if(actionName.equals(name_A_RTTimeOfDay_)){
+ return Arrays.asList(
+ new CsdlAction().setName(name_A_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter().setName("ParameterTimeOfDay").setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter().setName("ParameterAny").setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setBound(false)
+ .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)),
+
+ new CsdlAction().setName(name_A_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter().setName("ParameterTimeOfDay").setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter().setName("ParameterAny").setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setBound(true)
+ .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)),
+
+ new CsdlAction().setName(name_A_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString)
+ .setNullable(false),
+ new CsdlParameter().setName("ParameterTimeOfDay").setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter().setName("ParameterAny").setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setBound(true)
+ .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ }else if (actionName.equals(nameUARTString)) {
return Collections.singletonList(
new CsdlAction().setName(nameUARTString.getName())
.setReturnType(new CsdlReturnType().setType(PropertyProvider.nameString)));
@@ -288,8 +344,70 @@ public class ActionProvider {
.setNullable(false)
.setCollection(true)
.setType(EntityTypeProvider.nameETAllPrim))));
- }
-
+
+ }else if(actionName.equals(nameBAETTwoPrimRTString)){
+ return Collections.singletonList(
+ new CsdlAction().setName(nameBAETTwoPrimRTString.getName())
+ .setBound(true)
+ .setParameters(Collections.singletonList(
+ new CsdlParameter().setName("ParameterETTwoPrim").setType(EntityTypeProvider.nameETTwoPrim)
+ .setNullable(false)))
+ .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameString)));
+
+ }else if(actionName.equals(nameBAETTwoPrimRTCollString)){
+ return Collections.singletonList(
+ new CsdlAction().setName(nameBAETTwoPrimRTCollString.getName())
+ .setBound(true)
+ .setParameters(Collections.singletonList(
+ new CsdlParameter().setName("ParameterETTwoPrim").setType(EntityTypeProvider.nameETTwoPrim)
+ .setNullable(false)))
+ .setReturnType(new CsdlReturnType()
+ .setType(PropertyProvider.nameString)
+ .setCollection(true)));
+
+ }else if(actionName.equals(nameBAETTwoPrimRTCTAllPrim)){
+ return Collections.singletonList(
+ new CsdlAction().setName(nameBAETTwoPrimRTCTAllPrim.getName())
+ .setBound(true)
+ .setParameters(Collections.singletonList(
+ new CsdlParameter().setName("ParameterETTwoPrim").setType(EntityTypeProvider.nameETTwoPrim)
+ .setNullable(false)))
+ .setReturnType(new CsdlReturnType()
+ .setType(ComplexTypeProvider.nameCTAllPrim)));
+
+ }else if(actionName.equals(nameBAETTwoPrimRTCollCTAllPrim)){
+ return Collections.singletonList(
+ new CsdlAction().setName(nameBAETTwoPrimRTCollCTAllPrim.getName())
+ .setBound(true)
+ .setParameters(Collections.singletonList(
+ new CsdlParameter().setName("ParameterETTwoPrim").setType(EntityTypeProvider.nameETTwoPrim)
+ .setNullable(false)))
+ .setReturnType(new CsdlReturnType()
+ .setType(ComplexTypeProvider.nameCTAllPrim)
+ .setCollection(true)));
+
+ }else if(actionName.equals(nameBAETCompAllPrimRTETCompAllPrim)){
+ return Collections.singletonList(
+ new CsdlAction().setName(nameBAETCompAllPrimRTETCompAllPrim.getName())
+ .setBound(true)
+ .setParameters(Collections.singletonList(
+ new CsdlParameter().setName("ParameterETCompAllPrim").setType(EntityTypeProvider.nameETCompAllPrim)
+ .setNullable(false)))
+ .setReturnType(new CsdlReturnType()
+ .setType(EntityTypeProvider.nameETCompAllPrim)));
+
+ }else if(actionName.equals(nameBAETTwoKeyNavRTETTwoKeyNavParam)){
+ return Collections.singletonList(
+ new CsdlAction().setName(nameBAETTwoKeyNavRTETTwoKeyNavParam.getName())
+ .setBound(true)
+ .setEntitySetPath("BindingParam/NavPropertyETTwoKeyNavOne")
+ .setParameters(Arrays.asList(
+ new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setNullable(false),
+ new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)
+ .setNullable(false)))
+ .setReturnType(new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav)));
+ }
return null;
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
index 459e842..18fd7a0 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
@@ -49,6 +49,7 @@ public class ContainerProvider {
public static final String AIRT_COLL_ES_ALL_PRIM_PARAM = "AIRTCollESAllPrimParam";
public static final String AIRT = "AIRT";
public static final String AIRT_PARAM = "AIRTParam";
+ public static final String AI_RT_TIME_OF_DAY = "AIRTTimeOfDay";
public static final String AIRT_TWO_PARAM = "AIRTTwoParam";
public static final String AIRT_BYTE_NINE_PARAM = "AIRTByteNineParam";
public static final String ES_STREAM = "ESStream";
@@ -75,6 +76,7 @@ public class ContainerProvider {
List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
container.setEntitySets(entitySets);
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllPrimDefaultValues"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCollAllPrim"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoPrim"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixPrimCollComp"));
@@ -124,7 +126,8 @@ public class ContainerProvider {
actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AIRT_PARAM));
actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AIRT_TWO_PARAM));
actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AIRT_BYTE_NINE_PARAM));
-
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AI_RT_TIME_OF_DAY));
+
// FunctionImports
List<CsdlFunctionImport> functionImports = new ArrayList<CsdlFunctionImport>();
container.setFunctionImports(functionImports);
@@ -151,6 +154,7 @@ public class ContainerProvider {
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTCollCTNavFiveProp"));
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollESKeyNavContParam"));
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTByteNineParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FIC_RTTimeOfDay_"));
List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
annotations.add(new CsdlAnnotation().setTerm(TermProvider.TERM_DESCRIPTION.getFullQualifiedNameAsString())
@@ -164,7 +168,19 @@ public class ContainerProvider {
public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException {
if (entityContainer == nameContainer) {
- if (name.equals("ESAllPrim")) {
+ if (name.equals("ESAllPrimDefaultValues")) {
+ return new CsdlEntitySet()
+ .setName("ESAllPrimDefaultValues")
+ .setType(EntityTypeProvider.nameETAllPrimDefaultValues)
+ .setTitle("All PropertyTypes EntitySet with default values")
+ .setAnnotations(Arrays.asList(new CsdlAnnotation().setTerm("Core.Description").setExpression(
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
+ "Contains entities with all primitive types with default values")),
+ new CsdlAnnotation().setTerm(TermProvider.TERM_DATA.getFullQualifiedNameAsString()).setExpression(
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.Bool, "true"))
+ ));
+
+ }else if (name.equals("ESAllPrim")) {
return new CsdlEntitySet()
.setName("ESAllPrim")
.setType(EntityTypeProvider.nameETAllPrim)
@@ -691,9 +707,19 @@ public class ContainerProvider {
return new CsdlActionImport()
.setName(AIRT_BYTE_NINE_PARAM)
.setAction(ActionProvider.nameUARTByteNineParam);
- }
- }
+ } else if(name.equals(AI_RT_TIME_OF_DAY)){
+ return new CsdlActionImport()
+ .setName(AI_RT_TIME_OF_DAY)
+ .setAction(ActionProvider.name_A_RTTimeOfDay_)
+ .setAnnotations(Arrays.asList(new CsdlAnnotation().setTerm("Core.Description").setExpression(
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
+ "Action Import returns the given time of day")),
+ new CsdlAnnotation().setTerm(TermProvider.TERM_DATA.getFullQualifiedNameAsString()).setExpression(
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.Bool, "true"))
+ ));
+ }
+ }
return null;
}
@@ -701,7 +727,22 @@ public class ContainerProvider {
throws ODataException {
if (entityContainer.equals(nameContainer)) {
- if (name.equals("FINRTInt16")) {
+
+ if (name.equals("FIC_RTTimeOfDay_")){
+ return new CsdlFunctionImport()
+ .setName(name)
+ .setAnnotations(Arrays.asList(new CsdlAnnotation().setTerm(
+ TermProvider.TERM_DESCRIPTION.getFullQualifiedNameAsString()).setExpression(
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
+ "Overload with same unbound parameter name and different "
+ + "type Composable Importing:Edm.TimeOfDay (Edm.TimeOfDay) "
+ + "Returning:Edm.TimeOfDay")),
+ new CsdlAnnotation().setTerm(TermProvider.TERM_DATA.getFullQualifiedNameAsString()).setExpression(
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.Bool, "false"))))
+ .setFunction(FunctionProvider.name_FC_RTTimeOfDay_)
+ .setIncludeInServiceDocument(true);
+
+ }else if (name.equals("FINRTInt16")) {
return new CsdlFunctionImport()
.setName(name)
.setTitle("Simple FunctionImport")
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
index c327e8f..eac9743 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
@@ -34,6 +34,8 @@ public class EntityTypeProvider {
public static final FullQualifiedName nameETAllNullable = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETAllNullable");
public static final FullQualifiedName nameETAllPrim = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETAllPrim");
+ public static final FullQualifiedName nameETAllPrimDefaultValues = new FullQualifiedName(SchemaProvider.NAMESPACE,
+ "ETAllPrimDefaultValues");
public static final FullQualifiedName nameETBase = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETBase");
public static final FullQualifiedName nameETBaseTwoKeyNav = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETBaseTwoKeyNav");
@@ -84,7 +86,33 @@ public class EntityTypeProvider {
public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
- if (entityTypeName.equals(nameETAllPrim)) {
+ if(entityTypeName.equals(nameETAllPrimDefaultValues)){
+ return new CsdlEntityType()
+ .setName("ETAllPrimDefaultValues")
+ .setKey(Arrays.asList(
+ new CsdlPropertyRef().setName("PropertyInt16")))
+ .setProperties(Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyString_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyBoolean_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyByte_NotNullable_WithDefaultValue,
+ PropertyProvider.propertySByte_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyInt32_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyInt64_NotNullable_WithDefaultValue,
+ PropertyProvider.propertySingle_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyDouble_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyDecimal_Scale_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyBinary_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyDate_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyDateTimeOffset_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyDuration_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyGuid_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyTimeOfDay_NotNullable_WithDefaultValue,
+ PropertyProvider.propertyEnumString_ENString_NonNullable_WithDefaultValue,
+ PropertyProvider.propertyTypeDefinition_TDString_NonNullable_WithDefaultValue
+ ));
+
+ }else if (entityTypeName.equals(nameETAllPrim)) {
return new CsdlEntityType()
.setName("ETAllPrim")
.setKey(Arrays.asList(
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
index f40bd7f..2776d2d 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
@@ -69,7 +69,10 @@ public class FunctionProvider {
public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTTwoPrim =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollCTTwoPrim");
-
+
+ public static final FullQualifiedName nameBFNESTwoKeyNavRTString =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BFNESTwoKeyNavRTString");
+
public static final FullQualifiedName nameBFCESTwoKeyNavRTCollString =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollString");
@@ -126,6 +129,13 @@ public class FunctionProvider {
public static final FullQualifiedName nameBFCESKeyNavRTESTwoKeyNav =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESKeyNavRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTCollDecimal =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollDecimal");
+
+ // Unknown
+ public static final FullQualifiedName name_FC_RTTimeOfDay_ =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "_FC_RTTimeOfDay_");
// Unbound Functions
public static final FullQualifiedName nameUFCRTCollCTTwoPrim =
@@ -184,7 +194,12 @@ public class FunctionProvider {
public static final FullQualifiedName nameUFNRTByteNineParam =
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTByteNineParam");
-
+
+ public static final FullQualifiedName nameUFCRTCollDecimal =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollDecimal");
+
+ public static final FullQualifiedName nameUFCRTDecimal =
+ new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTDecimal");
public static List<CsdlFunction> getBoundFunctionsForType(FullQualifiedName entityType) throws ODataException {
FullQualifiedName[] funcNames = {
@@ -218,7 +233,10 @@ public class FunctionProvider {
nameBFESTwoKeyNavRTESTwoKeyNav,
nameBFCESTwoKeyNavRTCTNavFiveProp,
nameBFCESTwoKeyNavRTCollCTNavFiveProp,
- nameBFCESKeyNavRTESTwoKeyNav
+ nameBFCESKeyNavRTESTwoKeyNav,
+ nameBFCESTwoKeyNavRTCollDecimal,
+ nameBFNESTwoKeyNavRTString,
+ name_FC_RTTimeOfDay_
};
List<CsdlFunction> functions = new ArrayList<CsdlFunction>();
@@ -235,8 +253,132 @@ public class FunctionProvider {
}
public static List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException {
-
- if (functionName.equals(nameUFNRTInt16)) {
+
+ if(functionName.equals(name_FC_RTTimeOfDay_)){
+ List<CsdlFunction> functions = new ArrayList<CsdlFunction>();
+
+ functions.add(new CsdlFunction()
+ .setName(name_FC_RTTimeOfDay_.getName())
+ .setParameters(Collections.singletonList(
+ new CsdlParameter()
+ .setName("ParameterTimeOfDay")
+ .setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false)))
+ .setComposable(true)
+ .setBound(true)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ functions.add( new CsdlFunction()
+ .setName(name_FC_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter()
+ .setName("ParameterTimeOfDay")
+ .setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter()
+ .setName("ParameterAny")
+ .setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setComposable(true)
+ .setBound(true)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ functions.add( new CsdlFunction()
+ .setName(name_FC_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter()
+ .setName("ParameterTimeOfDay")
+ .setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter()
+ .setName("ParameterString")
+ .setType(PropertyProvider.nameString)
+ .setNullable(false),
+ new CsdlParameter()
+ .setName("ParameterAny")
+ .setType(PropertyProvider.nameInt32)
+ .setNullable(false)))
+ .setComposable(true)
+ .setBound(true)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ functions.add(new CsdlFunction()
+ .setName(name_FC_RTTimeOfDay_.getName())
+ .setParameters(Collections.singletonList(
+ new CsdlParameter()
+ .setName("ParameterTimeOfDay")
+ .setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false)))
+ .setComposable(true)
+ .setBound(false)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ functions.add( new CsdlFunction()
+ .setName(name_FC_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter()
+ .setName("ParameterTimeOfDay")
+ .setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter()
+ .setName("ParameterAny")
+ .setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setComposable(true)
+ .setBound(false)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ functions.add( new CsdlFunction()
+ .setName(name_FC_RTTimeOfDay_.getName())
+ .setParameters(Arrays.asList(
+ new CsdlParameter()
+ .setName("ParameterTimeOfDay")
+ .setType(PropertyProvider.nameTimeOfDay)
+ .setNullable(false),
+ new CsdlParameter()
+ .setName("ParameterString")
+ .setType(PropertyProvider.nameString)
+ .setNullable(false),
+ new CsdlParameter()
+ .setName("ParameterAny")
+ .setType(PropertyProvider.nameInt32)
+ .setNullable(false)))
+ .setComposable(true)
+ .setBound(false)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameTimeOfDay)));
+
+ return functions;
+
+ }else if(functionName.equals(nameUFCRTCollDecimal)){
+ return Collections.singletonList(
+ new CsdlFunction()
+ .setName(functionName.getName())
+ .setParameters(Collections.<CsdlParameter> emptyList())
+ .setComposable(true)
+ .setReturnType(new CsdlReturnType()
+ .setType(PropertyProvider.nameDecimal)
+ .setPrecision(12)
+ .setScale(5)
+ .setCollection(true)));
+
+ }else if(functionName.equals(nameUFCRTDecimal)){
+ return Collections.singletonList(
+ new CsdlFunction()
+ .setName(functionName.getName())
+ .setParameters(Collections.<CsdlParameter> emptyList())
+ .setComposable(true)
+ .setReturnType(new CsdlReturnType()
+ .setType(PropertyProvider.nameDecimal)
+ .setPrecision(12)
+ .setScale(5)));
+
+ }else if (functionName.equals(nameUFNRTInt16)) {
return Collections.singletonList(
new CsdlFunction()
.setName(functionName.getName())
@@ -649,6 +791,18 @@ public class FunctionProvider {
.setComposable(true)
.setReturnType(
new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false)));
+
+ } else if (functionName.equals(nameBFNESTwoKeyNavRTString)){
+ return Collections.singletonList(
+ new CsdlFunction()
+ .setName("BFNESTwoKeyNavRTString")
+ .setBound(true)
+ .setParameters(Collections.singletonList(
+ new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(false)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false)));
} else if (functionName.equals(nameBFCESTwoKeyNavRTCollString)) {
return Collections.singletonList(
@@ -861,6 +1015,26 @@ public class FunctionProvider {
.setComposable(true)
.setReturnType(
new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)));
+
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTCollDecimal)){
+ return Collections.singletonList(
+ new CsdlFunction()
+ .setName("BFCESTwoKeyNavRTCollDecimal")
+ .setBound(true)
+ .setParameters(
+ Collections.singletonList(
+ new CsdlParameter().setName("BindingParam")
+ .setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setNullable(false)
+ .setCollection(true)))
+ .setComposable(true)
+ .setBound(true)
+ .setReturnType(
+ new CsdlReturnType().setType(PropertyProvider.nameDecimal)
+ .setPrecision(12)
+ .setScale(5)
+ .setCollection(true)
+ .setNullable(false)));
} else if (functionName.equals(nameBFCETTwoKeyNavRTCTTwoPrim)) {
return Collections.singletonList(
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
index 42e253d..3abe050 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
@@ -332,6 +332,12 @@ public class PropertyProvider {
.setType(nameBinary)
.setNullable(false);
+ public static final CsdlProperty propertyBinary_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyBinary")
+ .setType(nameBinary)
+ .setDefaultValue("T0RhdGE")
+ .setNullable(false);
+
public static final CsdlProperty propertyBinary_ExplicitNullable = new CsdlProperty()
.setName("PropertyBinary")
.setType(nameBinary)
@@ -346,6 +352,12 @@ public class PropertyProvider {
.setType(nameBoolean)
.setNullable(false);
+ public static final CsdlProperty propertyBoolean_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyBoolean")
+ .setType(nameBoolean)
+ .setDefaultValue("true")
+ .setNullable(false);
+
public static final CsdlProperty propertyBoolean_ExplicitNullable = new CsdlProperty()
.setName("PropertyBoolean")
.setType(nameBoolean)
@@ -360,6 +372,12 @@ public class PropertyProvider {
.setType(nameByte)
.setNullable(false);
+ public static final CsdlProperty propertyByte_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyByte")
+ .setType(nameByte)
+ .setDefaultValue("255")
+ .setNullable(false);
+
public static final CsdlProperty propertyByte_ExplicitNullable = new CsdlProperty()
.setName("PropertyByte")
.setType(nameByte)
@@ -374,6 +392,12 @@ public class PropertyProvider {
.setType(nameDate)
.setNullable(false);
+ public static final CsdlProperty propertyDate_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyDate")
+ .setType(nameDate)
+ .setDefaultValue("2016-06-27")
+ .setNullable(false);
+
public static final CsdlProperty propertyDate_ExplicitNullable = new CsdlProperty()
.setName("PropertyDate")
.setType(nameDate)
@@ -393,6 +417,12 @@ public class PropertyProvider {
.setType(nameDateTimeOffset)
.setNullable(false);
+ public static final CsdlProperty propertyDateTimeOffset_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyDateTimeOffset")
+ .setType(nameDateTimeOffset)
+ .setDefaultValue("2016-06-27T14:52:23.123Z")
+ .setNullable(false);
+
public static final CsdlProperty propertyDateTimeOffset_ExplicitNullable = new CsdlProperty()
.setName("PropertyDateTimeOffset")
.setType(nameDateTimeOffset)
@@ -414,6 +444,13 @@ public class PropertyProvider {
.setType(nameDecimal)
.setNullable(false);
+ public static final CsdlProperty propertyDecimal_Scale_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyDecimal")
+ .setType(nameDecimal)
+ .setScale(10)
+ .setDefaultValue("123.0123456789")
+ .setNullable(false);
+
public static final CsdlProperty propertyDecimal_ExplicitNullable = new CsdlProperty()
.setName("PropertyDecimal")
.setType(nameDecimal)
@@ -428,6 +465,12 @@ public class PropertyProvider {
.setType(nameDouble)
.setNullable(false);
+ public static final CsdlProperty propertyDouble_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyDouble")
+ .setType(nameDouble)
+ .setDefaultValue("3.1415926535897931")
+ .setNullable(false);
+
public static final CsdlProperty propertyDouble_ExplicitNullable = new CsdlProperty()
.setName("PropertyDouble")
.setType(nameDouble)
@@ -441,7 +484,13 @@ public class PropertyProvider {
.setName("PropertyDuration")
.setType(nameDuration)
.setNullable(false);
-
+
+ public static final CsdlProperty propertyDuration_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyDuration")
+ .setType(nameDuration)
+ .setDefaultValue("P12DT23H59M59.999S")
+ .setNullable(false);
+
public static final CsdlProperty propertyDuration_ExplicitNullable = new CsdlProperty()
.setName("PropertyDuration")
.setType(nameDuration)
@@ -456,6 +505,12 @@ public class PropertyProvider {
.setType(nameGuid)
.setNullable(false);
+ public static final CsdlProperty propertyGuid_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyGuid")
+ .setType(nameGuid)
+ .setDefaultValue("01234567-89ab-cdef-0123-456789abcdef")
+ .setNullable(false);
+
public static final CsdlProperty propertyGuid_ExplicitNullable = new CsdlProperty()
.setName("PropertyGuid")
.setType(nameGuid)
@@ -470,6 +525,13 @@ public class PropertyProvider {
.setType(nameInt16)
.setNullable(false);
+ public static final CsdlProperty propertyInt16_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyInt16")
+ .setType(nameInt16)
+ .setDefaultValue("32767")
+ .setNullable(false);
+
+
public static final CsdlProperty propertyInt16_ExplicitNullable = new CsdlProperty()
.setName("PropertyInt16")
.setType(nameInt16)
@@ -484,6 +546,12 @@ public class PropertyProvider {
.setType(nameInt32)
.setNullable(false);
+ public static final CsdlProperty propertyInt32_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyInt32")
+ .setType(nameInt32)
+ .setDefaultValue("2147483647")
+ .setNullable(false);
+
public static final CsdlProperty propertyInt32_ExplicitNullable = new CsdlProperty()
.setName("PropertyInt32")
.setType(nameInt32)
@@ -498,6 +566,12 @@ public class PropertyProvider {
.setType(nameInt64)
.setNullable(false);
+ public static final CsdlProperty propertyInt64_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyInt64")
+ .setType(nameInt64)
+ .setDefaultValue("9223372036854775807")
+ .setNullable(false);
+
public static final CsdlProperty propertyInt64_ExplicitNullable = new CsdlProperty()
.setName("PropertyInt64")
.setType(nameInt64)
@@ -512,6 +586,12 @@ public class PropertyProvider {
.setType(nameSByte)
.setNullable(false);
+ public static final CsdlProperty propertySByte_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertySByte")
+ .setType(nameSByte)
+ .setDefaultValue("127")
+ .setNullable(false);
+
public static final CsdlProperty propertySByte_ExplicitNullable = new CsdlProperty()
.setName("PropertySByte")
.setType(nameSByte)
@@ -526,6 +606,12 @@ public class PropertyProvider {
.setType(nameSingle)
.setNullable(false);
+ public static final CsdlProperty propertySingle_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertySingle")
+ .setType(nameSingle)
+ .setDefaultValue("1.23")
+ .setNullable(false);
+
public static final CsdlProperty propertySingle_ExplicitNullable = new CsdlProperty()
.setName("PropertySingle")
.setType(nameSingle)
@@ -540,6 +626,12 @@ public class PropertyProvider {
.setType(nameString)
.setNullable(false);
+ public static final CsdlProperty propertyString_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyString")
+ .setType(nameString)
+ .setDefaultValue("abc")
+ .setNullable(false);
+
public static final CsdlProperty propertyString_ExplicitNullable = new CsdlProperty()
.setName("PropertyString")
.setType(nameString)
@@ -559,6 +651,12 @@ public class PropertyProvider {
.setType(nameTimeOfDay)
.setNullable(false);
+ public static final CsdlProperty propertyTimeOfDay_NotNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyTimeOfDay")
+ .setType(nameTimeOfDay)
+ .setDefaultValue("07:59:59.999")
+ .setNullable(false);
+
public static final CsdlProperty propertyTimeOfDay_ExplicitNullable = new CsdlProperty()
.setName("PropertyTimeOfDay")
.setType(nameTimeOfDay)
@@ -793,6 +891,12 @@ public class PropertyProvider {
.setName("PropertyEnumString")
.setType(EnumTypeProvider.nameENString)
.setNullable(false);
+
+ public static final CsdlProperty propertyEnumString_ENString_NonNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyEnumString")
+ .setType(EnumTypeProvider.nameENString)
+ .setDefaultValue("String1")
+ .setNullable(false);
public static final CsdlProperty propertyEnumString_ENString = new CsdlProperty()
.setName("PropertyEnumString")
@@ -813,6 +917,12 @@ public class PropertyProvider {
.setType(TypeDefinitionProvider.nameTDString)
.setNullable(false);
+ public static final CsdlProperty propertyTypeDefinition_TDString_NonNullable_WithDefaultValue = new CsdlProperty()
+ .setName("PropertyDefString")
+ .setType(TypeDefinitionProvider.nameTDString)
+ .setDefaultValue("CustomString")
+ .setNullable(false);
+
public static final CsdlProperty collPropertyTypeDefinition_TDString = new CsdlProperty()
.setName("CollPropertyDefString")
.setType(TypeDefinitionProvider.nameTDString)
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
index eb998b3..ac2f916 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
@@ -57,8 +57,9 @@ public class SchemaProvider {
// EntityTypes
List<CsdlEntityType> entityTypes = new ArrayList<CsdlEntityType>();
schema.setEntityTypes(entityTypes);
-
+
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllPrimDefaultValues));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCollAllPrim));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoPrim));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixPrimCollComp));
@@ -116,6 +117,12 @@ public class SchemaProvider {
actions.addAll(prov.getActions(ActionProvider.nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav));
actions.addAll(prov.getActions(ActionProvider.nameBAETAllPrimRT));
actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRT));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoPrimRTString));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoPrimRTCollString));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoPrimRTCTAllPrim));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoPrimRTCollCTAllPrim));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETCompAllPrimRTETCompAllPrim));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNavParam));
actions.addAll(prov.getActions(ActionProvider.nameUARTString));
actions.addAll(prov.getActions(ActionProvider.nameUARTCollStringTwoParam));
actions.addAll(prov.getActions(ActionProvider.nameUARTCTTwoPrimParam));
@@ -128,11 +135,13 @@ public class SchemaProvider {
actions.addAll(prov.getActions(ActionProvider.nameUARTParam));
actions.addAll(prov.getActions(ActionProvider.nameUARTTwoParam));
actions.addAll(prov.getActions(ActionProvider.nameUARTByteNineParam));
-
+ actions.addAll(prov.getActions(ActionProvider.name_A_RTTimeOfDay_));
+
// Functions
List<CsdlFunction> functions = new ArrayList<CsdlFunction>();
schema.setFunctions(functions);
-
+
+ functions.addAll(prov.getFunctions(FunctionProvider.name_FC_RTTimeOfDay_));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNav));
@@ -156,6 +165,8 @@ public class SchemaProvider {
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTCollCTNavFiveProp));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollETKeyNavContParam));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTByteNineParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollDecimal));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTDecimal));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFC_RTESTwoKeyNav_));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCStringRTESTwoKeyNav));
@@ -187,6 +198,8 @@ public class SchemaProvider {
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNavParam));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTETTwoKeyNavParam));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFNESTwoKeyNavRTString));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollDecimal));
// functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNavParam));
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
index dae060a..568ae52 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
@@ -666,18 +666,68 @@ public class ODataJsonSerializerTest {
+ "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
+ "\"value\":[{\"@odata.type\":\"#olingo.odata.test1.ETTwoPrim\",\"@odata.id\":\"ESTwoPrim(32766)\","
+ "\"PropertyInt16@odata.type\":\"#Int16\",\"PropertyInt16\":32766,"
- + "\"PropertyString\":\"Test String1\"},"
+ + "\"PropertyString\":\"Test String1\","
+ +"\"#olingo.odata.test1.BAETTwoPrimRTString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTString\","
+ +"\"target\":\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollString\","
+ +"\"target\":\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTCollString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"}"
+ + "},"
+ "{\"@odata.type\":\"#olingo.odata.test1.ETTwoPrim\",\"@odata.id\":\"ESTwoPrim(-365)\","
+ "\"PropertyInt16@odata.type\":\"#Int16\",\"PropertyInt16\":-365,"
+ "\"PropertyString\":\"Test String2\","
- + "\"NavPropertyETAllPrimMany@odata.navigationLink\":\"ESTwoPrim(-365)/NavPropertyETAllPrimMany\"},"
+ + "\"NavPropertyETAllPrimMany@odata.navigationLink\":\"ESTwoPrim(-365)/NavPropertyETAllPrimMany\","
+ +"\"#olingo.odata.test1.BAETTwoPrimRTString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTString\","
+ +"\"target\":\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollString\","
+ +"\"target\":\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCollString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"}},"
+ "{\"@odata.type\":\"#olingo.odata.test1.ETTwoPrim\",\"@odata.id\":\"ESTwoPrim(-32766)\","
+ "\"PropertyInt16@odata.type\":\"#Int16\",\"PropertyInt16\":-32766,"
- + "\"PropertyString\":null},"
+ + "\"PropertyString\":null,"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTString\","
+ +"\"target\":\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollString\","
+ +"\"target\":\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTCollString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"}},"
+ "{\"@odata.type\":\"#olingo.odata.test1.ETTwoPrim\",\"@odata.id\":\"ESTwoPrim(32767)\","
+ "\"PropertyInt16@odata.type\":\"#Int16\",\"PropertyInt16\":32767,"
+ "\"PropertyString\":\"Test String4\","
- + "\"NavPropertyETAllPrimOne@odata.navigationLink\":\"ESAllPrim(32767)\"}]}";
+ +"\"NavPropertyETAllPrimOne@odata.navigationLink\":\"ESAllPrim(32767)\","
+ +"\"#olingo.odata.test1.BAETTwoPrimRTString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTString\","
+ +"\"target\":\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollString\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollString\","
+ +"\"target\":\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollString\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"},"
+ +"\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\":"
+ +"{\"title\":\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\","
+ +"\"target\":\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"}"
+ +"}]}";
Assert.assertEquals(expectedResult, resultString);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fd2592d4/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
index 381f862..7d718bd 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
@@ -615,6 +615,9 @@ public class ODataXmlSerializerTest {
" </d:PropertyComp>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETCompAllPrimRTETCompAllPrim\" " +
+ " title=\"olingo.odata.test1.BAETCompAllPrimRTETCompAllPrim\" " +
+ " target=\"ESCompAllPrim(32767)/olingo.odata.test1.BAETCompAllPrimRTETCompAllPrim\"/>" +
"</a:entry>";
checkXMLEqual(expected, resultString);
}
@@ -1501,6 +1504,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String4</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
"</a:entry>\n" +
"";
checkXMLEqual(expected, resultString);
@@ -1587,6 +1602,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String4</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ "<m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
"</a:entry>";
checkXMLEqual(expected, resultString);
}
@@ -1659,6 +1686,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String4</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTString\" "
+ + "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" "
+ + "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "
+ + "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "
+ + "target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
" </a:entry>\n" +
" </m:inline>\n" +
" </a:link>\n" +
@@ -1694,6 +1733,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String2</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTString\" "
+ + "target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" "
+ + "target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "
+ + "target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "
+ + "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "
+ + "target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
" </a:entry>\n" +
" </a:feed>\n" +
" </m:inline>\n" +
@@ -1710,7 +1761,7 @@ public class ODataXmlSerializerTest {
" target=\"ESAllPrim(32767)/olingo.odata.test1.BAETAllPrimRT\" />\n" +
"</a:entry>\n" +
"";
- checkXMLEqual(expected, resultString);
+ checkXMLEqual(expected, resultString);
}
@Test
@@ -1909,6 +1960,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String1</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" " +
+ "title=\"olingo.odata.test1.BAETTwoPrimRTString\" \n" +
+ " target=\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" \n" +
+ " target=\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" " +
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(32766)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
" </a:entry>\n" +
" <a:entry>\n" +
" <a:id>ESTwoPrim(-32766)</a:id>\n" +
@@ -1936,6 +1999,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString m:null=\"true\" />\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTString\" \n" +
+ " target=\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" \n" +
+ " target=\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(-32766)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
" </a:entry>\n" +
" <a:entry>\n" +
" <a:id>ESTwoPrim(32767)</a:id>\n" +
@@ -1963,6 +2038,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String4</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTString\" \n" +
+ " target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" \n" +
+ " target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(32767)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
" </a:entry>\n" +
" </a:feed>\n" +
" </m:inline>\n" +
@@ -1989,6 +2076,18 @@ public class ODataXmlSerializerTest {
" <d:PropertyString>Test String2</d:PropertyString>\n" +
" </m:properties>\n" +
" </a:content>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTString\" \n" +
+ " target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollString\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollString\" \n" +
+ " target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCollString\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCTAllPrim\"/>\n" +
+ " <m:action metadata=\"#olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" "+
+ "title=\"olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\" \n" +
+ " target=\"ESTwoPrim(-365)/olingo.odata.test1.BAETTwoPrimRTCollCTAllPrim\"/>" +
"</a:entry>";
checkXMLEqual(expected, resultString);
}