[OLINGO-545] TecSvc EDM enhanced

This commit is contained in:
Christian Holzer 2015-03-31 18:47:57 +02:00
parent 3e8c50646e
commit 15cfa375e8
15 changed files with 265 additions and 55 deletions

View File

@ -359,7 +359,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
final ODataEntity entity = entityResponse.getBody(); final ODataEntity entity = entityResponse.getBody();
assertNotNull(entity); assertNotNull(entity);
final ODataComplexValue complex = entity.getProperty("PropertyCompCompNav").getComplexValue() final ODataComplexValue complex = entity.getProperty("PropertyCompCompNav").getComplexValue()
.get("PropertyComp").getComplexValue(); .get("PropertyCompNav").getComplexValue();
assertNotNull(complex); assertNotNull(complex);
final ODataProperty property = complex.get("PropertyInt16"); final ODataProperty property = complex.get("PropertyInt16");
assertNotNull(property); assertNotNull(property);

View File

@ -61,7 +61,6 @@ public class BindingITCase extends AbstractBaseTestITCase {
private static final String CT_NAV_FIVE_PROP = "CTNavFiveProp"; private static final String CT_NAV_FIVE_PROP = "CTNavFiveProp";
private static final String PROPERTY_INT16 = "PropertyInt16"; private static final String PROPERTY_INT16 = "PropertyInt16";
private static final String PROPERTY_STRING = "PropertyString"; private static final String PROPERTY_STRING = "PropertyString";
private static final String PROPERTY_COMP = "PropertyComp";
private static final String PROPERTY_COMP_NAV = "PropertyCompNav"; private static final String PROPERTY_COMP_NAV = "PropertyCompNav";
private static final String PROPERTY_COMP_COMP_NAV = "PropertyCompCompNav"; private static final String PROPERTY_COMP_COMP_NAV = "PropertyCompCompNav";
private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim"; private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim";
@ -96,7 +95,7 @@ public class BindingITCase extends AbstractBaseTestITCase {
entity.getProperties() entity.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42"))) .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42))))))); .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
// Bind existing entities via binding synatx // Bind existing entities via binding synatx

View File

@ -64,7 +64,6 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
private static final String CT_NAV_FIVE_PROP = "CTNavFiveProp"; private static final String CT_NAV_FIVE_PROP = "CTNavFiveProp";
private static final String PROPERTY_INT16 = "PropertyInt16"; private static final String PROPERTY_INT16 = "PropertyInt16";
private static final String PROPERTY_STRING = "PropertyString"; private static final String PROPERTY_STRING = "PropertyString";
private static final String PROPERTY_COMP = "PropertyComp";
private static final String PROPERTY_COMP_NAV = "PropertyCompNav"; private static final String PROPERTY_COMP_NAV = "PropertyCompNav";
private static final String PROPERTY_COMP_COMP_NAV = "PropertyCompCompNav"; private static final String PROPERTY_COMP_COMP_NAV = "PropertyCompCompNav";
private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim"; private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim";
@ -103,7 +102,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
entity.getProperties() entity.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42"))) .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42))))))); .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
// Non collection navigation property // Non collection navigation property
@ -114,7 +113,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
inlineEntitySingle.getProperties() inlineEntitySingle.getProperties()
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("43"))); .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("43")));
inlineEntitySingle.getProperties() inlineEntitySingle.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 431))))); .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 431)))));
inlineEntitySingle.getProperties() inlineEntitySingle.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_TWO_PRIM, of.newComplexValue(CT_TWO_PRIM) .add(of.newComplexProperty(PROPERTY_COMP_TWO_PRIM, of.newComplexValue(CT_TWO_PRIM)
@ -130,7 +129,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
inlineEntityCol1.getProperties() inlineEntityCol1.getProperties()
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("44"))); .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("44")));
inlineEntityCol1.getProperties() inlineEntityCol1.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 441))))); .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 441)))));
inlineEntityCol1.getProperties() inlineEntityCol1.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_TWO_PRIM, of.newComplexValue(CT_TWO_PRIM) .add(of.newComplexProperty(PROPERTY_COMP_TWO_PRIM, of.newComplexValue(CT_TWO_PRIM)
@ -143,7 +142,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
inlineEntityCol2.getProperties() inlineEntityCol2.getProperties()
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("45"))); .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("45")));
inlineEntityCol2.getProperties() inlineEntityCol2.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 451))))); .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 451)))));
inlineEntityCol2.getProperties() inlineEntityCol2.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_TWO_PRIM, of.newComplexValue(CT_TWO_PRIM) .add(of.newComplexProperty(PROPERTY_COMP_TWO_PRIM, of.newComplexValue(CT_TWO_PRIM)
@ -184,7 +183,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
// Check nav. property NavPropertyETTwoKeyNavOne // Check nav. property NavPropertyETTwoKeyNavOne
assertNotNull(esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_ONE)); assertNotNull(esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_ONE));
assertEquals(431, esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_ONE).getComplexValue().get( assertEquals(431, esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_ONE).getComplexValue().get(
PROPERTY_COMP).getComplexValue().get(PROPERTY_INT16).getPrimitiveValue().toValue()); PROPERTY_COMP_NAV).getComplexValue().get(PROPERTY_INT16).getPrimitiveValue().toValue());
// Check nav. property NavPropertyETTwoKeyNavMany // Check nav. property NavPropertyETTwoKeyNavMany
assertNotNull(esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_MANY)); assertNotNull(esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_MANY));
@ -193,10 +192,10 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
Iterator<ODataValue> twoKeyNavManyIterator = Iterator<ODataValue> twoKeyNavManyIterator =
esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_MANY).getCollectionValue().iterator(); esKeyNavResponse.getBody().getProperty(NAV_PROPERTY_ET_TWO_KEY_NAV_MANY).getCollectionValue().iterator();
final ODataValue firstTwoKeyNavEnity = twoKeyNavManyIterator.next(); // First entity final ODataValue firstTwoKeyNavEnity = twoKeyNavManyIterator.next(); // First entity
assertEquals(441, firstTwoKeyNavEnity.asComplex().get(PROPERTY_COMP).getValue().asComplex().get( assertEquals(441, firstTwoKeyNavEnity.asComplex().get(PROPERTY_COMP_NAV).getValue().asComplex().get(
PROPERTY_INT16).getPrimitiveValue().toValue()); PROPERTY_INT16).getPrimitiveValue().toValue());
final ODataValue secondTwoKeyNavEnity = twoKeyNavManyIterator.next(); // Second entity final ODataValue secondTwoKeyNavEnity = twoKeyNavManyIterator.next(); // Second entity
assertEquals(451, secondTwoKeyNavEnity.asComplex().get(PROPERTY_COMP).getValue().asComplex().get( assertEquals(451, secondTwoKeyNavEnity.asComplex().get(PROPERTY_COMP_NAV).getValue().asComplex().get(
PROPERTY_INT16).getPrimitiveValue().toValue()); PROPERTY_INT16).getPrimitiveValue().toValue());
// Fetch ESTwoKeyNav entities and check if available and the partner relation have been set up // Fetch ESTwoKeyNav entities and check if available and the partner relation have been set up
@ -218,7 +217,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
.getEntityRequest(esTwoKeyNavEntitySingleURI); .getEntityRequest(esTwoKeyNavEntitySingleURI);
esTwoKeyNavSingleRequest.addCustomHeader(HttpHeader.COOKIE, cookie); esTwoKeyNavSingleRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
final ODataRetrieveResponse<ODataEntity> esTwoKeyNavSingleResponse = esTwoKeyNavSingleRequest.execute(); final ODataRetrieveResponse<ODataEntity> esTwoKeyNavSingleResponse = esTwoKeyNavSingleRequest.execute();
assertEquals(431, esTwoKeyNavSingleResponse.getBody().getProperty(PROPERTY_COMP).getComplexValue().get( assertEquals(431, esTwoKeyNavSingleResponse.getBody().getProperty(PROPERTY_COMP_NAV).getComplexValue().get(
PROPERTY_INT16).getPrimitiveValue().toValue()); PROPERTY_INT16).getPrimitiveValue().toValue());
// Check ESTwoKeyNav(Created via NavPropertyETTwoKeyNavMany(0)) // Check ESTwoKeyNav(Created via NavPropertyETTwoKeyNavMany(0))
@ -236,7 +235,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
esTwoKeyNavManyOneRequest.addCustomHeader(HttpHeader.COOKIE, cookie); esTwoKeyNavManyOneRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
final ODataRetrieveResponse<ODataEntity> esTwoKeyNavManyOneResponse = esTwoKeyNavManyOneRequest.execute(); final ODataRetrieveResponse<ODataEntity> esTwoKeyNavManyOneResponse = esTwoKeyNavManyOneRequest.execute();
assertEquals(441, esTwoKeyNavManyOneResponse.getBody().getProperty(PROPERTY_COMP).getComplexValue().get( assertEquals(441, esTwoKeyNavManyOneResponse.getBody().getProperty(PROPERTY_COMP_NAV).getComplexValue().get(
PROPERTY_INT16).getPrimitiveValue().toValue()); PROPERTY_INT16).getPrimitiveValue().toValue());
assertNotNull(esTwoKeyNavManyOneResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue()); assertNotNull(esTwoKeyNavManyOneResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue());
assertEquals(propertyInt16.getPrimitiveValue().toValue(), esTwoKeyNavManyOneResponse.getBody().getProperty( assertEquals(propertyInt16.getPrimitiveValue().toValue(), esTwoKeyNavManyOneResponse.getBody().getProperty(
@ -257,7 +256,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
esTwoKeyNavManyTwoRequest.addCustomHeader(HttpHeader.COOKIE, cookie); esTwoKeyNavManyTwoRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
final ODataRetrieveResponse<ODataEntity> esTwoKeyNavManyTwoResponse = esTwoKeyNavManyTwoRequest.execute(); final ODataRetrieveResponse<ODataEntity> esTwoKeyNavManyTwoResponse = esTwoKeyNavManyTwoRequest.execute();
assertEquals(451, esTwoKeyNavManyTwoResponse.getBody().getProperty(PROPERTY_COMP).getComplexValue().get( assertEquals(451, esTwoKeyNavManyTwoResponse.getBody().getProperty(PROPERTY_COMP_NAV).getComplexValue().get(
PROPERTY_INT16).getPrimitiveValue().toValue()); PROPERTY_INT16).getPrimitiveValue().toValue());
assertNotNull(esTwoKeyNavManyTwoResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue()); assertNotNull(esTwoKeyNavManyTwoResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue());
assertEquals(propertyInt16.getPrimitiveValue().toValue(), esTwoKeyNavManyTwoResponse.getBody().getProperty( assertEquals(propertyInt16.getPrimitiveValue().toValue(), esTwoKeyNavManyTwoResponse.getBody().getProperty(
@ -289,7 +288,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
entity.getProperties() entity.getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42"))) .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42))))))); .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
// Prepare inline entity(EntitySet: ESKeyNav, Type: ETKeyNav) // Prepare inline entity(EntitySet: ESKeyNav, Type: ETKeyNav)
@ -312,7 +311,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
.getProperties() .getProperties()
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP) .add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("431"))) .add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("431")))
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP) .add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder() .add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder()
.buildInt16((short) 431))))))); .buildInt16((short) 431)))))));

View File

@ -959,11 +959,11 @@ public class FilterSystemQueryITCase extends AbstractBaseTestITCase {
// Do the filter request // Do the filter request
ODataRetrieveResponse<ODataEntitySet> result = ODataRetrieveResponse<ODataEntitySet> result =
sendRequest("ESKeyNav", "PropertyCompCompNav/PropertyComp/PropertyInt16 eq 1", cookie); sendRequest("ESKeyNav", "PropertyCompCompNav/PropertyCompNav/PropertyInt16 eq 1", cookie);
assertEquals(3, result.getBody().getEntities().size()); assertEquals(3, result.getBody().getEntities().size());
// Try filter all entries where PropertyCompComp is null // Try filter all entries where PropertyCompComp is null
result = sendRequest("ESKeyNav", "PropertyCompCompNav/PropertyComp/PropertyInt16 eq null", cookie); result = sendRequest("ESKeyNav", "PropertyCompCompNav/PropertyCompNav/PropertyInt16 eq null", cookie);
assertEquals(1, result.getBody().getEntities().size()); assertEquals(1, result.getBody().getEntities().size());
} }

View File

@ -138,7 +138,7 @@ public class DataCreator {
createKeyNavAllPrimComplexValue("PropertyComp")))) createKeyNavAllPrimComplexValue("PropertyComp"))))
.addProperty(createComplex("PropertyCompCompNav", .addProperty(createComplex("PropertyCompCompNav",
createPrimitive("PropertyString", "1"), createPrimitive("PropertyString", "1"),
createComplex("PropertyComp", createPrimitive("PropertyInt16", 1)))); createComplex("PropertyCompNav", createPrimitive("PropertyInt16", 1))));
} }
private EntitySet createESTwoKeyNav() { private EntitySet createESTwoKeyNav() {

View File

@ -37,6 +37,9 @@ public class ActionProvider {
public static final FullQualifiedName nameBAESTwoKeyNavRTESTwoKeyNav = public static final FullQualifiedName nameBAESTwoKeyNavRTESTwoKeyNav =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BAESTwoKeyNavRTESTwoKeyNav"); new FullQualifiedName(SchemaProvider.NAMESPACE, "BAESTwoKeyNavRTESTwoKeyNav");
public static final FullQualifiedName nameBAESTwoKeyNavRTESKeyNav =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BAESTwoKeyNavRTESKeyNav");
public static final FullQualifiedName nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav = public static final FullQualifiedName nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETBaseTwoKeyNavRTETBaseTwoKeyNav"); new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
@ -45,7 +48,10 @@ public class ActionProvider {
public static final FullQualifiedName nameBAETTwoKeyNavRTETTwoKeyNav = public static final FullQualifiedName nameBAETTwoKeyNavRTETTwoKeyNav =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoKeyNavRTETTwoKeyNav"); new FullQualifiedName(SchemaProvider.NAMESPACE, "BAETTwoKeyNavRTETTwoKeyNav");
public static final FullQualifiedName nameBAETAllPrimRT =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BAESAllPrimRT");
// Unbound Actions // Unbound Actions
public static final FullQualifiedName nameUARTString = new FullQualifiedName(SchemaProvider.NAMESPACE, public static final FullQualifiedName nameUARTString = new FullQualifiedName(SchemaProvider.NAMESPACE,
"UARTString"); "UARTString");
@ -69,7 +75,6 @@ public class ActionProvider {
public static final FullQualifiedName nameUARTTwoParam = public static final FullQualifiedName nameUARTTwoParam =
new FullQualifiedName(SchemaProvider.NAMESPACE, "UARTTwoParam"); new FullQualifiedName(SchemaProvider.NAMESPACE, "UARTTwoParam");
public List<Action> getActions(final FullQualifiedName actionName) throws ODataException { public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
if (actionName.equals(nameUARTString)) { if (actionName.equals(nameUARTString)) {
return Arrays.asList( return Arrays.asList(
@ -80,7 +85,8 @@ public class ActionProvider {
return Arrays.asList( return Arrays.asList(
new Action().setName(nameUARTCollStringTwoParam.getName()) new Action().setName(nameUARTCollStringTwoParam.getName())
.setParameters(Arrays.asList( .setParameters(Arrays.asList(
new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16),
new Parameter().setName("ParameterDuration").setType(PropertyProvider.nameDuration)))
.setReturnType(new ReturnType().setType(PropertyProvider.nameString).setCollection(true)) .setReturnType(new ReturnType().setType(PropertyProvider.nameString).setCollection(true))
); );
@ -91,7 +97,7 @@ public class ActionProvider {
new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16) new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)
.setNullable(false))) .setNullable(false)))
.setReturnType( .setReturnType(
new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim)) new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
); );
} else if (actionName.equals(nameUARTCollCTTwoPrimParam)) { } else if (actionName.equals(nameUARTCollCTTwoPrimParam)) {
@ -134,7 +140,8 @@ public class ActionProvider {
return Arrays.asList( return Arrays.asList(
new Action().setName(nameUARTCollETAllPrimParam.getName()) new Action().setName(nameUARTCollETAllPrimParam.getName())
.setParameters(Arrays.asList( .setParameters(Arrays.asList(
new Parameter().setName("ParameterTimeOfDay").setType(PropertyProvider.nameInt16))) new Parameter().setName("ParameterTimeOfDay")
.setType(PropertyProvider.nameTimeOfDay)))
.setReturnType( .setReturnType(
new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true)) new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true))
); );
@ -199,7 +206,20 @@ public class ActionProvider {
.setReturnType( .setReturnType(
new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)) new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true))
); );
} else if(actionName.equals(nameBAESTwoKeyNavRTESKeyNav)) {
return Arrays.asList(
new Action().setName("BAESTwoKeyNavRTESKeyNav")
.setBound(true)
.setEntitySetPath("BindingParam/NavPropertyETKeyNavMany")
.setParameters(Arrays.asList(
new Parameter().setName("ParameterETTwoKeyNav")
.setType(EntityTypeProvider.nameETTwoKeyNav)
.setCollection(true)
.setNullable(false)
))
.setReturnType(new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))
);
} else if (actionName.equals(nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav)) { } else if (actionName.equals(nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav)) {
return Arrays.asList( return Arrays.asList(
new Action().setName("BAETBaseTwoKeyNavRTETBaseTwoKeyNav") new Action().setName("BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
@ -222,7 +242,25 @@ public class ActionProvider {
.setReturnType( .setReturnType(
new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav)) new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav))
); );
} } else if(actionName.equals(nameBAETAllPrimRT)) {
return Arrays.asList(
new Action().setName("BAETAllPrimRT")
.setBound(true)
.setParameters(Arrays.asList(
new Parameter().setName("ParameterETAllPrim")
.setNullable(false)
.setType(EntityTypeProvider.nameETAllPrim)
)),
new Action().setName("BAETAllPrimRT")
.setBound(true)
.setParameters(Arrays.asList(
new Parameter().setName("ParameterETAllPrim")
.setNullable(false)
.setCollection(true)
.setType(EntityTypeProvider.nameETAllPrim)
))
);
}
return null; return null;
} }

View File

@ -18,6 +18,7 @@
*/ */
package org.apache.olingo.server.tecsvc.provider; package org.apache.olingo.server.tecsvc.provider;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.ODataException;
@ -51,6 +52,7 @@ public class ComplexTypeProvider {
public static final FullQualifiedName nameCTTwoPrim = new FullQualifiedName(SchemaProvider.NAMESPACE, "CTTwoPrim"); public static final FullQualifiedName nameCTTwoPrim = new FullQualifiedName(SchemaProvider.NAMESPACE, "CTTwoPrim");
public static final FullQualifiedName nameCTMixEnumDef = new FullQualifiedName(SchemaProvider.NAMESPACE, public static final FullQualifiedName nameCTMixEnumDef = new FullQualifiedName(SchemaProvider.NAMESPACE,
"CTMixEnumDef"); "CTMixEnumDef");
public static final FullQualifiedName nameCTNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE, "CTNavCont");
public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
@ -65,12 +67,11 @@ public class ComplexTypeProvider {
.setProperties( .setProperties(
Arrays.asList(PropertyProvider.propertyString, PropertyProvider.propertyBinary, Arrays.asList(PropertyProvider.propertyString, PropertyProvider.propertyBinary,
PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertyDate, PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertyDate,
PropertyProvider.propertyDateTimeOffset, PropertyProvider.propertyDecimal, PropertyProvider.propertyDateTimeOffset, PropertyProvider.propertyDecimal_Scale_Precision,
PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDuration, PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDuration,
PropertyProvider.propertyGuid, PropertyProvider.propertyInt16, PropertyProvider.propertyInt32, PropertyProvider.propertyGuid, PropertyProvider.propertyInt16, PropertyProvider.propertyInt32,
PropertyProvider.propertyInt64, PropertyProvider.propertySByte, PropertyProvider.propertyTimeOfDay PropertyProvider.propertyInt64, PropertyProvider.propertySByte, PropertyProvider.propertyTimeOfDay
)); ));
} else if (complexTypeName.equals(nameCTCollAllPrim)) { } else if (complexTypeName.equals(nameCTCollAllPrim)) {
return new ComplexType() return new ComplexType()
.setName("CTCollAllPrim") .setName("CTCollAllPrim")
@ -96,7 +97,7 @@ public class ComplexTypeProvider {
return new ComplexType() return new ComplexType()
.setName("CTCompNav") .setName("CTCompNav")
.setProperties(Arrays.asList(PropertyProvider.propertyString, .setProperties(Arrays.asList(PropertyProvider.propertyString,
PropertyProvider.propertyComp_CTNavFiveProp)); PropertyProvider.propertyCompNav_CTNavFiveProp));
} else if (complexTypeName.equals(nameCTMixPrimCollComp)) { } else if (complexTypeName.equals(nameCTMixPrimCollComp)) {
return new ComplexType() return new ComplexType()
@ -148,7 +149,17 @@ public class ComplexTypeProvider {
.setName("NavPropertyETMediaMany") .setName("NavPropertyETMediaMany")
.setType(EntityTypeProvider.nameETMedia).setCollection(true) .setType(EntityTypeProvider.nameETMedia).setCollection(true)
))); )));
} else if(complexTypeName.equals(nameCTNavCont)) {
return new ComplexType()
.setName("CTNavCont")
.setProperties(new ArrayList<Property>())
.setNavigationProperties(Arrays.asList(
PropertyProvider.collectionNavPropertyETKeyNavContMany_CT_ETKeyNav,
PropertyProvider.navPropertyETKeyNavContOne_CT_ETeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav,
PropertyProvider.navPropertyETTwoKeyNavContOne_CT_ETKeyNav));
} else if (complexTypeName.equals(nameCTBasePrimCompNav)) { } else if (complexTypeName.equals(nameCTBasePrimCompNav)) {
return new ComplexType() return new ComplexType()
.setName("CTBasePrimCompNav") .setName("CTBasePrimCompNav")

View File

@ -288,7 +288,7 @@ public class ContainerProvider {
.setPath("NavPropertyETMediaMany") .setPath("NavPropertyETMediaMany")
.setTarget("ESMedia"), .setTarget("ESMedia"),
new NavigationPropertyBinding() new NavigationPropertyBinding()
.setPath("PropertyCompNav/NavPropertyETTwoKeyNavOn") .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOne")
.setTarget("ESTwoKeyNav"), .setTarget("ESTwoKeyNav"),
new NavigationPropertyBinding() new NavigationPropertyBinding()
.setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany")
@ -370,15 +370,55 @@ public class ContainerProvider {
.setPath("NavPropertyETTwoBaseTwoKeyNavOne") .setPath("NavPropertyETTwoBaseTwoKeyNavOne")
.setTarget("ESBaseTwoKeyNav"), .setTarget("ESBaseTwoKeyNav"),
new NavigationPropertyBinding() new NavigationPropertyBinding()
.setPath("NavPropertySINav") .setPath("ETBaseTwoKeyNav/CollPropertyCompNav/NavPropertyETTwoKeyNavMany")
.setTarget("SINav") .setTarget("ESTwoKeyNav"),
new NavigationPropertyBinding()
.setPath("ETBaseTwoKeyNav/NavPropertyETTwoBaseTwoKeyNavOne")
.setTarget("ESBaseTwoKeyNav"),
new NavigationPropertyBinding()
.setPath("NavPropertySINav")
.setTarget("SINav")
)); ));
} else if(name.equals("ESKeyNavCont")) {
return new EntitySet()
.setName("ESKeyNavCont")
.setType(EntityTypeProvider.nameETKeyNavCont)
.setNavigationPropertyBindings(Arrays.asList(
new NavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new NavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new NavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavContMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new NavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavContOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new NavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new NavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav")
));
} else if (name.equals("ESBaseTwoKeyNav")) { } else if (name.equals("ESBaseTwoKeyNav")) {
return new EntitySet() return new EntitySet()
.setName("ESBaseTwoKeyNav") .setName("ESBaseTwoKeyNav")
.setType(EntityTypeProvider.nameETBaseTwoKeyNav); .setType(EntityTypeProvider.nameETBaseTwoKeyNav)
.setNavigationPropertyBindings(Arrays.asList(
new NavigationPropertyBinding()
.setPath("NavPropertyETKeyNavMany")
.setTarget("ESKeyNav"))
);
} else if(name.equals("ESTwoBaseTwoKeyNav")) {
return new EntitySet()
.setName("ESTwoBaseTwoKeyNav")
.setType(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
} else if (name.equals("ESCompMixPrimCollComp")) { } else if (name.equals("ESCompMixPrimCollComp")) {
return new EntitySet() return new EntitySet()
.setName("ESCompMixPrimCollComp") .setName("ESCompMixPrimCollComp")
@ -434,11 +474,13 @@ public class ContainerProvider {
} else if (name.equals(AIRTES_ALL_PRIM_PARAM)) { } else if (name.equals(AIRTES_ALL_PRIM_PARAM)) {
return new ActionImport() return new ActionImport()
.setName(AIRTES_ALL_PRIM_PARAM) .setName(AIRTES_ALL_PRIM_PARAM)
.setEntitySet("ESAllPrim")
.setAction(ActionProvider.nameUARTETAllPrimParam); .setAction(ActionProvider.nameUARTETAllPrimParam);
} else if (name.equals(AIRT_COLL_ES_ALL_PRIM_PARAM)) { } else if (name.equals(AIRT_COLL_ES_ALL_PRIM_PARAM)) {
return new ActionImport() return new ActionImport()
.setName(AIRT_COLL_ES_ALL_PRIM_PARAM) .setName(AIRT_COLL_ES_ALL_PRIM_PARAM)
.setEntitySet("ESAllPrim")
.setAction(ActionProvider.nameUARTCollETAllPrimParam); .setAction(ActionProvider.nameUARTCollETAllPrimParam);
} else if (name.equals(AIRT)) { } else if (name.equals(AIRT)) {
@ -605,7 +647,14 @@ public class ContainerProvider {
.setNavigationPropertyBindings(Arrays.asList( .setNavigationPropertyBindings(Arrays.asList(
new NavigationPropertyBinding() new NavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavMany") .setPath("NavPropertyETTwoKeyNavMany")
.setTarget("ESTwoKeyNav"))); .setTarget("ESTwoKeyNav"),
new NavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavOne")
.setTarget("ESTwoKeyNav"),
new NavigationPropertyBinding()
.setPath("NavPropertyETKeyNavOne")
.setTarget("ESKeyNav")
));
} else if (name.equals("SIMedia")) { } else if (name.equals("SIMedia")) {
return new Singleton() return new Singleton()

View File

@ -55,6 +55,8 @@ public class EntityTypeProvider {
public static final FullQualifiedName nameETKeyNav = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETKeyNav"); public static final FullQualifiedName nameETKeyNav = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETKeyNav");
public static final FullQualifiedName nameETKeyPrimNav = new FullQualifiedName(SchemaProvider.NAMESPACE, public static final FullQualifiedName nameETKeyPrimNav = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyPrimNav"); "ETKeyPrimNav");
public static final FullQualifiedName nameETKeyNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyNavCont");
public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.NAMESPACE, public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyTwoKeyComp"); "ETKeyTwoKeyComp");
public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETMedia"); public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETMedia");
@ -89,7 +91,7 @@ public class EntityTypeProvider {
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString, PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString,
PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertySByte, PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertySByte,
PropertyProvider.propertyInt32, PropertyProvider.propertyInt64, PropertyProvider.propertyInt32, PropertyProvider.propertyInt64,
PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDecimal, PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDecimal_Scale,
PropertyProvider.propertyBinary, PropertyProvider.propertyDate, PropertyProvider.propertyDateTimeOffset, PropertyProvider.propertyBinary, PropertyProvider.propertyDate, PropertyProvider.propertyDateTimeOffset,
PropertyProvider.propertyDuration, PropertyProvider.propertyGuid, PropertyProvider.propertyTimeOfDay PropertyProvider.propertyDuration, PropertyProvider.propertyGuid, PropertyProvider.propertyTimeOfDay
)) ))
@ -319,8 +321,7 @@ public class EntityTypeProvider {
PropertyProvider.navPropertyETKeyNavOne_ETKeyNav, PropertyProvider.navPropertyETKeyNavOne_ETKeyNav,
PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav, PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav,
PropertyProvider.navPropertyETMediaOne_ETMedia, PropertyProvider.navPropertyETMediaOne_ETMedia,
PropertyProvider.collectionNavPropertyETMediaMany_ETMedia PropertyProvider.collectionNavPropertyETMediaMany_ETMedia));
));
} else if (entityTypeName.equals(nameETKeyPrimNav)) { } else if (entityTypeName.equals(nameETKeyPrimNav)) {
return new EntityType() return new EntityType()
.setName("ETKeyPrimNav") .setName("ETKeyPrimNav")
@ -330,6 +331,17 @@ public class EntityTypeProvider {
.setNavigationProperties( .setNavigationProperties(
Arrays.asList( Arrays.asList(
PropertyProvider.navPropertyETKeyPrimNavOne_ETKeyPrimNav)); PropertyProvider.navPropertyETKeyPrimNavOne_ETKeyPrimNav));
} else if(entityTypeName.equals(nameETKeyNavCont)) {
return new EntityType()
.setName("ETKeyNavCont")
.setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16")))
.setProperties(Arrays.asList(
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
PropertyProvider.propertyCompNavCont))
.setNavigationProperties(Arrays.asList(
PropertyProvider.navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav
));
} else if (entityTypeName.equals(nameETTwoKeyNav)) { } else if (entityTypeName.equals(nameETTwoKeyNav)) {
return new EntityType() return new EntityType()
@ -358,7 +370,8 @@ public class EntityTypeProvider {
.setReferencedProperty("PropertyInt16"))), .setReferencedProperty("PropertyInt16"))),
PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav, PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav,
PropertyProvider.navPropertyETTwoKeyNavOne_ETTwoKeyNav, PropertyProvider.navPropertyETTwoKeyNavOne_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav)); PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
PropertyProvider.collectionNavPropertySINav));
} else if (entityTypeName.equals(nameETBaseTwoKeyNav)) { } else if (entityTypeName.equals(nameETBaseTwoKeyNav)) {
return new EntityType() return new EntityType()

View File

@ -118,7 +118,10 @@ public class FunctionProvider {
public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName( public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName(
SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollCTNavFiveProp"); SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollCTNavFiveProp");
public static final FullQualifiedName nameBFCESKeyNavRTESTwoKeyNav =
new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESKeyNavRTESTwoKeyNav");
// Unbound Functions // Unbound Functions
public static final FullQualifiedName nameUFCRTCollCTTwoPrim = public static final FullQualifiedName nameUFCRTCollCTTwoPrim =
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollCTTwoPrim"); new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollCTTwoPrim");
@ -163,7 +166,10 @@ public class FunctionProvider {
public static final FullQualifiedName nameUFCRTCollETMixPrimCollCompTwoParam = public static final FullQualifiedName nameUFCRTCollETMixPrimCollCompTwoParam =
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETMixPrimCollCompTwoParam"); new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETMixPrimCollCompTwoParam");
public static final FullQualifiedName nameUFCRTCollETKeyNavContParam =
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETKeyNavContParam");
public static final FullQualifiedName nameUFNRTInt16 = public static final FullQualifiedName nameUFNRTInt16 =
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTInt16"); new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTInt16");
@ -263,6 +269,21 @@ public class FunctionProvider {
.setReturnType( .setReturnType(
new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
); );
} else if(functionName.equals(nameUFCRTCollETKeyNavContParam)) {
return Arrays.asList(
new Function()
.setName("UFCRTCollETKeyNavContParam")
.setBound(true)
.setComposable(true)
.setParameters(Arrays.asList(
new Parameter().setName("ParameterInt16")
.setNullable(false)
.setType(PropertyProvider.nameInt16)))
.setReturnType(new ReturnType().setType(EntityTypeProvider.nameETKeyNavCont)
.setCollection(true)
.setNullable(false))
);
} else if (functionName.equals(nameUFCRTString)) { } else if (functionName.equals(nameUFCRTString)) {
return Arrays.asList( return Arrays.asList(
@ -317,7 +338,7 @@ public class FunctionProvider {
.setName("UFCRTCTTwoPrimParam") .setName("UFCRTCTTwoPrimParam")
.setParameters(Arrays.asList( .setParameters(Arrays.asList(
new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false), new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false),
new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(true))) new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false)))
.setComposable(true) .setComposable(true)
.setReturnType( .setReturnType(
new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
@ -358,7 +379,9 @@ public class FunctionProvider {
return Arrays.asList( return Arrays.asList(
new Function() new Function()
.setName("UFCRTETMedia") .setName("UFCRTETMedia")
.setParameters(new ArrayList<Parameter>()) .setParameters(Arrays.asList(
new Parameter().setName("ParameterInt16").setNullable(false).setType(PropertyProvider.nameInt16)
))
.setComposable(true) .setComposable(true)
.setReturnType( .setReturnType(
new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false)) new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false))
@ -730,6 +753,7 @@ public class FunctionProvider {
.setParameters(Arrays.asList( .setParameters(Arrays.asList(
new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setNullable(false))) new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setNullable(false)))
.setComposable(true) .setComposable(true)
.setEntitySetPath("BindingParam/NavPropertyETKeyNavOne")
.setReturnType( .setReturnType(
new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
); );
@ -747,7 +771,27 @@ public class FunctionProvider {
new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
); );
} else if(functionName.equals(nameBFCESKeyNavRTESTwoKeyNav)) {
return Arrays.asList(
new Function()
.setName("BFCESKeyNavRTESTwoKeyNav")
.setEntitySetPath("BindingParam/NavPropertyETTwoKeyNavMany")
.setBound(true)
.setComposable(true)
.setParameters(Arrays.asList(
new Parameter().setName("BindingParam")
.setNullable(false)
.setType(EntityTypeProvider.nameETKeyNav)
.setCollection(true),
new Parameter().setName("ParameterString")
.setNullable(false)
.setType(PropertyProvider.nameString)))
.setReturnType(new ReturnType()
.setNullable(false)
.setType(EntityTypeProvider.nameETTwoKeyNav)
.setCollection(true))
);
} else if (functionName.equals(nameBFCETTwoKeyNavRTETTwoKeyNav)) { } else if (functionName.equals(nameBFCETTwoKeyNavRTETTwoKeyNav)) {
return Arrays.asList( return Arrays.asList(
new Function() new Function()

View File

@ -393,11 +393,17 @@ public class PropertyProvider {
.setType(nameDateTimeOffset) .setType(nameDateTimeOffset)
.setNullable(true); .setNullable(true);
public static final Property propertyDecimal = new Property() public static final Property propertyDecimal_Scale_Precision = new Property()
.setName("PropertyDecimal")
.setScale(10)
.setPrecision(11)
.setType(nameDecimal);
public static final Property propertyDecimal_Scale = new Property()
.setName("PropertyDecimal") .setName("PropertyDecimal")
.setScale(10) .setScale(10)
.setType(nameDecimal); .setType(nameDecimal);
public static final Property propertyDecimal_NotNullable = new Property() public static final Property propertyDecimal_NotNullable = new Property()
.setName("PropertyDecimal") .setName("PropertyDecimal")
.setType(nameDecimal) .setType(nameDecimal)
@ -579,7 +585,7 @@ public class PropertyProvider {
public static final Property propertyComp_CTNavFiveProp = new Property() public static final Property propertyComp_CTNavFiveProp = new Property()
.setName("PropertyComp") .setName("PropertyComp")
.setType(ComplexTypeProvider.nameCTNavFiveProp); .setType(ComplexTypeProvider.nameCTNavFiveProp);
public static final Property propertyCompNav_CTNavFiveProp = new Property() public static final Property propertyCompNav_CTNavFiveProp = new Property()
.setName("PropertyCompNav") .setName("PropertyCompNav")
.setType(ComplexTypeProvider.nameCTNavFiveProp); .setType(ComplexTypeProvider.nameCTNavFiveProp);
@ -598,6 +604,10 @@ public class PropertyProvider {
.setType(ComplexTypeProvider.nameCTTwoPrim) .setType(ComplexTypeProvider.nameCTTwoPrim)
.setNullable(false); .setNullable(false);
public static final Property propertyCompNavCont = new Property()
.setName("PropertyCompNavCont")
.setType(ComplexTypeProvider.nameCTNavCont);
public static final Property propertyCompAllPrim_CTAllPrim = new Property() public static final Property propertyCompAllPrim_CTAllPrim = new Property()
.setName("PropertyCompAllPrim") .setName("PropertyCompAllPrim")
.setType(ComplexTypeProvider.nameCTAllPrim); .setType(ComplexTypeProvider.nameCTAllPrim);
@ -665,6 +675,23 @@ public class PropertyProvider {
.setType(EntityTypeProvider.nameETAllPrim) .setType(EntityTypeProvider.nameETAllPrim)
.setCollection(true); .setCollection(true);
public static final NavigationProperty collectionNavPropertySINav = new NavigationProperty()
.setName("NavPropertySINav")
.setCollection(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final NavigationProperty collectionNavPropertyETKeyNavContMany_CT_ETKeyNav = new NavigationProperty()
.setName("NavPropertyETKeyNavContMany")
.setCollection(true)
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
public static final NavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav = new NavigationProperty()
.setName("NavPropertyETTwoKeyNavContMany")
.setCollection(true)
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
public static final NavigationProperty navPropertyETKeyNavOne_ETKeyNav = new NavigationProperty() public static final NavigationProperty navPropertyETKeyNavOne_ETKeyNav = new NavigationProperty()
.setName("NavPropertyETKeyNavOne") .setName("NavPropertyETKeyNavOne")
.setType(EntityTypeProvider.nameETKeyNav); .setType(EntityTypeProvider.nameETKeyNav);
@ -695,6 +722,28 @@ public class PropertyProvider {
.setName("NavPropertyETAllPrimOne") .setName("NavPropertyETAllPrimOne")
.setType(EntityTypeProvider.nameETAllPrim); .setType(EntityTypeProvider.nameETAllPrim);
public static final NavigationProperty navPropertyETKeyNavContOne_CT_ETeyNav = new NavigationProperty()
.setName("NavPropertyETKeyNavContOne")
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
public static final NavigationProperty navPropertyETTwoKeyNavContOne_CT_ETKeyNav = new NavigationProperty()
.setName("NavPropertyETTwoKeyNavContOne")
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
public static final NavigationProperty navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav = new NavigationProperty()
.setName("NavPropertyETKeyNavContOne")
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final NavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav
= new NavigationProperty()
.setName("NavPropertyETTwoKeyNavContMany")
.setContainsTarget(true)
.setCollection(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);
// EnumProperties -------------------------------------------------------------------------------------------------- // EnumProperties --------------------------------------------------------------------------------------------------
public static final Property propertyEnumString_ENString = new Property() public static final Property propertyEnumString_ENString = new Property()
.setName("PropertyEnumString") .setName("PropertyEnumString")

View File

@ -79,7 +79,8 @@ public class SchemaProvider {
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstract)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstract));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstractBase)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstractBase));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixEnumDefCollComp)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixEnumDefCollComp));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyNavCont));
// ComplexTypes // ComplexTypes
List<ComplexType> complexType = new ArrayList<ComplexType>(); List<ComplexType> complexType = new ArrayList<ComplexType>();
schema.setComplexTypes(complexType); schema.setComplexTypes(complexType);
@ -98,7 +99,8 @@ public class SchemaProvider {
complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBasePrimCompNav)); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBasePrimCompNav));
complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompNav)); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompNav));
complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixEnumDef)); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixEnumDef));
complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTNavCont));
// TypeDefinitions // TypeDefinitions
List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>(); List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
schema.setTypeDefinitions(typeDefinitions); schema.setTypeDefinitions(typeDefinitions);
@ -107,8 +109,10 @@ public class SchemaProvider {
// Actions // Actions
List<Action> actions = new ArrayList<Action>(); List<Action> actions = new ArrayList<Action>();
schema.setActions(actions); schema.setActions(actions);
actions.addAll(prov.getActions(ActionProvider.nameBAETAllPrimRT));
actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNav)); actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNav));
actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRTETAllPrim)); actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRTETAllPrim));
actions.addAll(prov.getActions(ActionProvider.nameBAESTwoKeyNavRTESKeyNav));
actions.addAll(prov.getActions(ActionProvider.nameBAESTwoKeyNavRTESTwoKeyNav)); actions.addAll(prov.getActions(ActionProvider.nameBAESTwoKeyNavRTESTwoKeyNav));
actions.addAll(prov.getActions(ActionProvider.nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav)); actions.addAll(prov.getActions(ActionProvider.nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav));
actions.addAll(prov.getActions(ActionProvider.nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav)); actions.addAll(prov.getActions(ActionProvider.nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav));
@ -131,6 +135,7 @@ public class SchemaProvider {
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16)); functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollETKeyNavContParam));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParam)); functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParam));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParamCTTwoPrim)); functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParamCTTwoPrim));
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTStringTwoParam)); functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTStringTwoParam));
@ -168,6 +173,7 @@ public class SchemaProvider {
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollCTPrimCompRTESAllPrim)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollCTPrimCompRTESAllPrim));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTTwoKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTTwoKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTESTwoKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETKeyNavRTETKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETKeyNavRTETKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFESTwoKeyNavRTESTwoKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFESTwoKeyNavRTESTwoKeyNav));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTETTwoKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTETTwoKeyNav));
@ -180,7 +186,7 @@ public class SchemaProvider {
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNavParam)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNavParam));
functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTETTwoKeyNavParam)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTETTwoKeyNavParam));
// functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNavParam)); // functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNavParam));
// EntityContainer // EntityContainer
schema.setEntityContainer(prov.getEntityContainer()); schema.setEntityContainer(prov.getEntityContainer());

View File

@ -369,7 +369,7 @@ public class ODataHandlerTest {
dispatchMethodNotAllowed(HttpMethod.PUT, complexCountUri, complexCountProcessor); dispatchMethodNotAllowed(HttpMethod.PUT, complexCountUri, complexCountProcessor);
dispatchMethodNotAllowed(HttpMethod.DELETE, complexCountUri, complexCountProcessor); dispatchMethodNotAllowed(HttpMethod.DELETE, complexCountUri, complexCountProcessor);
final String mediaUri = "FICRTESMedia()/$value"; final String mediaUri = "FICRTESMedia(ParameterInt16=1)/$value";
final MediaEntityProcessor mediaProcessor = mock(MediaEntityProcessor.class); final MediaEntityProcessor mediaProcessor = mock(MediaEntityProcessor.class);
dispatch(HttpMethod.GET, mediaUri, mediaProcessor); dispatch(HttpMethod.GET, mediaUri, mediaProcessor);
verify(mediaProcessor).readMediaEntity( verify(mediaProcessor).readMediaEntity(

View File

@ -88,8 +88,8 @@ public class MetadataDocumentTest {
assertThat(metadata, containsString("<Action Name=\"UARTCTTwoPrimParam\" IsBound=\"false\">" assertThat(metadata, containsString("<Action Name=\"UARTCTTwoPrimParam\" IsBound=\"false\">"
+ "<Parameter Name=\"ParameterInt16\" Type=\"Edm.Int16\" Nullable=\"false\"/>" + "<Parameter Name=\"ParameterInt16\" Type=\"Edm.Int16\" Nullable=\"false\"/>"
+ "<ReturnType Type=\"Namespace1_Alias.CTTwoPrim\"/></Action>")); + "<ReturnType Type=\"Namespace1_Alias.CTTwoPrim\" Nullable=\"false\"/></Action>"));
assertThat(metadata, assertThat(metadata,
containsString("<Action Name=\"BAESAllPrimRTETAllPrim\" IsBound=\"true\">" containsString("<Action Name=\"BAESAllPrimRTETAllPrim\" IsBound=\"true\">"
+ "<Parameter Name=\"ParameterESAllPrim\" " + "<Parameter Name=\"ParameterESAllPrim\" "
@ -114,6 +114,8 @@ public class MetadataDocumentTest {
assertThat(metadata, assertThat(metadata,
containsString("<Singleton Name=\"SINav\" EntityType=\"Namespace1_Alias.ETTwoKeyNav\">" containsString("<Singleton Name=\"SINav\" EntityType=\"Namespace1_Alias.ETTwoKeyNav\">"
+ "<NavigationPropertyBinding Path=\"NavPropertyETTwoKeyNavMany\" Target=\"ESTwoKeyNav\"/>" + "<NavigationPropertyBinding Path=\"NavPropertyETTwoKeyNavMany\" Target=\"ESTwoKeyNav\"/>"
+ "<NavigationPropertyBinding Path=\"NavPropertyETTwoKeyNavOne\" Target=\"ESTwoKeyNav\"/>"
+ "<NavigationPropertyBinding Path=\"NavPropertyETKeyNavOne\" Target=\"ESKeyNav\"/>"
+ "</Singleton>")); + "</Singleton>"));
assertThat(metadata, assertThat(metadata,

View File

@ -1724,7 +1724,7 @@ public class TestFullResourcePath {
.isKeyPredicate(0, "PropertyInt16", "2") .isKeyPredicate(0, "PropertyInt16", "2")
.isKeyPredicate(1, "PropertyString", "'3'"); .isKeyPredicate(1, "PropertyString", "'3'");
testUri.run("FICRTESMedia()/$value") testUri.run("FICRTESMedia(ParameterInt16=1)/$value")
.isKind(UriInfoKind.resource).goPath() .isKind(UriInfoKind.resource).goPath()
.first() .first()
.isFunctionImport("FICRTESMedia") .isFunctionImport("FICRTESMedia")