[OLINGO-557] Some function imports for technical service
Change-Id: I4f6589672eed8c70dd138d74f09dbd3caddf6cfb Signed-off-by: Michael Bolz <michael.bolz@sap.com>
This commit is contained in:
parent
0d57a0763a
commit
93f2ed5cf2
|
@ -24,7 +24,6 @@ import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -119,11 +118,9 @@ public class BasicITCase extends AbstractBaseTestITCase {
|
||||||
XMLMetadata xmlMetadata = response.getBody();
|
XMLMetadata xmlMetadata = response.getBody();
|
||||||
|
|
||||||
assertNotNull(xmlMetadata);
|
assertNotNull(xmlMetadata);
|
||||||
assertTrue(xmlMetadata instanceof XMLMetadata);
|
|
||||||
assertEquals(2, xmlMetadata.getSchemas().size());
|
assertEquals(2, xmlMetadata.getSchemas().size());
|
||||||
assertEquals("olingo.odata.test1", xmlMetadata.getSchema("olingo.odata.test1").getNamespace());
|
assertEquals("olingo.odata.test1", xmlMetadata.getSchema("olingo.odata.test1").getNamespace());
|
||||||
final List<Reference> references =
|
final List<Reference> references = xmlMetadata.getReferences();
|
||||||
((XMLMetadata) xmlMetadata).getReferences();
|
|
||||||
assertEquals(1, references.size());
|
assertEquals(1, references.size());
|
||||||
assertThat(references.get(0).getUri().toASCIIString(), containsString("vocabularies/Org.OData.Core.V1"));
|
assertThat(references.get(0).getUri().toASCIIString(), containsString("vocabularies/Org.OData.Core.V1"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.olingo.fit.tecsvc.client;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.olingo.client.api.ODataClient;
|
||||||
|
import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest;
|
||||||
|
import org.apache.olingo.client.api.communication.response.ODataInvokeResponse;
|
||||||
|
import org.apache.olingo.client.core.ODataClientFactory;
|
||||||
|
import org.apache.olingo.commons.api.domain.ODataEntity;
|
||||||
|
import org.apache.olingo.commons.api.domain.ODataEntitySet;
|
||||||
|
import org.apache.olingo.commons.api.domain.ODataProperty;
|
||||||
|
import org.apache.olingo.commons.api.domain.ODataValue;
|
||||||
|
import org.apache.olingo.commons.api.format.ODataFormat;
|
||||||
|
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
||||||
|
import org.apache.olingo.fit.AbstractBaseTestITCase;
|
||||||
|
import org.apache.olingo.fit.tecsvc.TecSvcConst;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class FunctionImportITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void entity() throws Exception {
|
||||||
|
final ODataInvokeRequest<ODataEntity> request = getClient().getInvokeRequestFactory()
|
||||||
|
.getFunctionInvokeRequest(getClient().newURIBuilder(TecSvcConst.BASE_URI)
|
||||||
|
.appendOperationCallSegment("FICRTESTwoKeyNav").build(), ODataEntity.class);
|
||||||
|
assertNotNull(request);
|
||||||
|
|
||||||
|
final ODataInvokeResponse<ODataEntity> response = request.execute();
|
||||||
|
assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
|
||||||
|
|
||||||
|
final ODataEntity entity = response.getBody();
|
||||||
|
assertNotNull(entity);
|
||||||
|
final ODataProperty property = entity.getProperty("PropertyInt16");
|
||||||
|
assertNotNull(property);
|
||||||
|
assertEquals(1, property.getPrimitiveValue().toValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void entityCollection() {
|
||||||
|
final ODataInvokeRequest<ODataEntitySet> request = getClient().getInvokeRequestFactory()
|
||||||
|
.getFunctionInvokeRequest(getClient().newURIBuilder(TecSvcConst.BASE_URI)
|
||||||
|
.appendOperationCallSegment("FICRTCollESTwoKeyNavParam").build(), ODataEntitySet.class,
|
||||||
|
Collections.<String, ODataValue> singletonMap("ParameterInt16",
|
||||||
|
getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(2)));
|
||||||
|
assertNotNull(request);
|
||||||
|
|
||||||
|
final ODataInvokeResponse<ODataEntitySet> response = request.execute();
|
||||||
|
assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
|
||||||
|
|
||||||
|
final ODataEntitySet entitySet = response.getBody();
|
||||||
|
assertNotNull(entitySet);
|
||||||
|
final List<ODataEntity> entities = entitySet.getEntities();
|
||||||
|
assertNotNull(entities);
|
||||||
|
assertEquals(2, entities.size());
|
||||||
|
final ODataEntity entity = entities.get(1);
|
||||||
|
assertNotNull(entity);
|
||||||
|
final ODataProperty property = entity.getProperty("PropertyString");
|
||||||
|
assertNotNull(property);
|
||||||
|
assertNotNull(property.getPrimitiveValue());
|
||||||
|
assertEquals("2", property.getPrimitiveValue().toValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ODataClient getClient() {
|
||||||
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
|
return odata;
|
||||||
|
}
|
||||||
|
}
|
|
@ -139,13 +139,13 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
|
||||||
@Override
|
@Override
|
||||||
protected void loadAllFunctionImports() {
|
protected void loadAllFunctionImports() {
|
||||||
loadContainer();
|
loadContainer();
|
||||||
List<FunctionImport> providerFuctionImports = container.getFunctionImports();
|
List<FunctionImport> providerFunctionImports = container.getFunctionImports();
|
||||||
if (providerFuctionImports != null) {
|
if (providerFunctionImports != null) {
|
||||||
for (FunctionImport functionImport : providerFuctionImports) {
|
for (FunctionImport functionImport : providerFunctionImports) {
|
||||||
String functionName = functionImport.getName();
|
String functionName = functionImport.getName();
|
||||||
if (!functionImports.containsKey(functionName)) {
|
if (!functionImports.containsKey(functionName)) {
|
||||||
EdmFunctionImportImpl impl = new EdmFunctionImportImpl(edm, this, functionImport);
|
functionImports.put(functionName,
|
||||||
functionImports.put(functionName, impl);
|
new EdmFunctionImportImpl(edm, this, functionImport));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,16 +29,17 @@ import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.apache.olingo.commons.api.data.ComplexValue;
|
||||||
import org.apache.olingo.commons.api.data.Entity;
|
import org.apache.olingo.commons.api.data.Entity;
|
||||||
import org.apache.olingo.commons.api.data.EntitySet;
|
import org.apache.olingo.commons.api.data.EntitySet;
|
||||||
import org.apache.olingo.commons.api.data.Link;
|
import org.apache.olingo.commons.api.data.Link;
|
||||||
import org.apache.olingo.commons.api.data.ComplexValue;
|
|
||||||
import org.apache.olingo.commons.api.data.Property;
|
import org.apache.olingo.commons.api.data.Property;
|
||||||
import org.apache.olingo.commons.api.data.ValueType;
|
import org.apache.olingo.commons.api.data.ValueType;
|
||||||
|
import org.apache.olingo.commons.api.domain.ODataLinkType;
|
||||||
|
import org.apache.olingo.commons.core.data.ComplexValueImpl;
|
||||||
import org.apache.olingo.commons.core.data.EntityImpl;
|
import org.apache.olingo.commons.core.data.EntityImpl;
|
||||||
import org.apache.olingo.commons.core.data.EntitySetImpl;
|
import org.apache.olingo.commons.core.data.EntitySetImpl;
|
||||||
import org.apache.olingo.commons.core.data.LinkImpl;
|
import org.apache.olingo.commons.core.data.LinkImpl;
|
||||||
import org.apache.olingo.commons.core.data.ComplexValueImpl;
|
|
||||||
import org.apache.olingo.commons.core.data.PropertyImpl;
|
import org.apache.olingo.commons.core.data.PropertyImpl;
|
||||||
|
|
||||||
public class DataCreator {
|
public class DataCreator {
|
||||||
|
@ -68,23 +69,22 @@ public class DataCreator {
|
||||||
linkESTwoKeyNav(data);
|
linkESTwoKeyNav(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Map<String, EntitySet> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
private EntitySet createESServerSidePaging() {
|
private EntitySet createESServerSidePaging() {
|
||||||
EntitySet entitySet = new EntitySetImpl();
|
EntitySet entitySet = new EntitySetImpl();
|
||||||
|
|
||||||
for(int i = 1; i <= 503; i++) {
|
for (int i = 1; i <= 503; i++) {
|
||||||
entitySet.getEntities().add(new EntityImpl()
|
entitySet.getEntities().add(new EntityImpl()
|
||||||
.addProperty(createPrimitive("PropertyInt16", i))
|
.addProperty(createPrimitive("PropertyInt16", i))
|
||||||
.addProperty(createPrimitive("PropertyString", "Number:" + i))
|
.addProperty(createPrimitive("PropertyString", "Number:" + i)));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return entitySet;
|
return entitySet;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, EntitySet> getData() {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
private EntitySet createESKeyNav() {
|
private EntitySet createESKeyNav() {
|
||||||
final EntitySet entitySet = new EntitySetImpl();
|
final EntitySet entitySet = new EntitySetImpl();
|
||||||
|
|
||||||
|
@ -95,44 +95,35 @@ public class DataCreator {
|
||||||
return entitySet;
|
return entitySet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private Entity createETKeyNavEntity(int propertyInt16, String propertyString) {
|
private Entity createETKeyNavEntity(int propertyInt16, String propertyString) {
|
||||||
// PropertyCompAllPrim
|
|
||||||
ComplexValue cvCompAllPrim = createKeyNavAllPrimComplexValue();
|
|
||||||
|
|
||||||
// CollPropertyComp
|
|
||||||
List<ComplexValue> ccComp = new ArrayList<ComplexValue>();
|
|
||||||
ccComp.add(createCTPrimCompValue(1));
|
|
||||||
ccComp.add(createCTPrimCompValue(2));
|
|
||||||
ccComp.add(createCTPrimCompValue(3));
|
|
||||||
|
|
||||||
return new EntityImpl()
|
return new EntityImpl()
|
||||||
.addProperty(createPrimitive("PropertyInt16", propertyInt16))
|
.addProperty(createPrimitive("PropertyInt16", propertyInt16))
|
||||||
.addProperty(createPrimitive("PropertyString", propertyString))
|
.addProperty(createPrimitive("PropertyString", propertyString))
|
||||||
.addProperty(createComplex("PropertyComp",
|
.addProperty(createComplex("PropertyComp",
|
||||||
createPrimitive("PropertyInt16", 1)))
|
createPrimitive("PropertyInt16", 1)))
|
||||||
.addProperty(new PropertyImpl(null, "PropertyCompAllPrim", ValueType.COMPLEX, cvCompAllPrim))
|
.addProperty(createKeyNavAllPrimComplexValue("PropertyCompAllPrim"))
|
||||||
.addProperty(createComplex("PropertyCompTwoPrim",
|
.addProperty(createComplex("PropertyCompTwoPrim",
|
||||||
createPrimitive("PropertyInt16", 16),
|
createPrimitive("PropertyInt16", 16),
|
||||||
createPrimitive("PropertyString", "Test123")))
|
createPrimitive("PropertyString", "Test123")))
|
||||||
.addProperty(createPrimitiveCollection("CollPropertyString",
|
.addProperty(createPrimitiveCollection("CollPropertyString",
|
||||||
"Employee1@company.example",
|
"Employee1@company.example",
|
||||||
"Employee2@company.example",
|
"Employee2@company.example",
|
||||||
"Employee3@company.example"))
|
"Employee3@company.example"))
|
||||||
.addProperty(createPrimitiveCollection("CollPropertyInt16", 1000, 2000, 30112))
|
.addProperty(createPrimitiveCollection("CollPropertyInt16", 1000, 2000, 30112))
|
||||||
.addProperty(new PropertyImpl(null, "CollPropertyComp", ValueType.COLLECTION_COMPLEX, ccComp))
|
.addProperty(createComplexCollection("CollPropertyComp",
|
||||||
.addProperty(createComplex("PropertyCompComp",
|
Arrays.asList(
|
||||||
createPrimitive("PropertyString", "1"),
|
createPrimitive("PropertyInt16", 1),
|
||||||
createComplex("PropertyComp", createPrimitive("PropertyInt16", 1))));
|
createKeyNavAllPrimComplexValue("PropertyComp")),
|
||||||
}
|
Arrays.asList(
|
||||||
|
createPrimitive("PropertyInt16", 2),
|
||||||
private ComplexValue createCTPrimCompValue(int properyInt16) {
|
createKeyNavAllPrimComplexValue("PropertyComp")),
|
||||||
final ComplexValue cvBasePrimCompNav = new ComplexValueImpl();
|
Arrays.asList(
|
||||||
final ComplexValue cvAllPrim = createKeyNavAllPrimComplexValue();
|
createPrimitive("PropertyInt16", 3),
|
||||||
|
createKeyNavAllPrimComplexValue("PropertyComp"))))
|
||||||
cvBasePrimCompNav.getValue().add(createPrimitive("PropertyInt16", properyInt16));
|
.addProperty(createComplex("PropertyCompComp",
|
||||||
cvBasePrimCompNav.getValue().add(new PropertyImpl(null, "PropertyComp", ValueType.COMPLEX, cvAllPrim));
|
createPrimitive("PropertyString", "1"),
|
||||||
|
createComplex("PropertyComp", createPrimitive("PropertyInt16", 1))));
|
||||||
return cvBasePrimCompNav;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntitySet createESTwoKeyNav() {
|
private EntitySet createESTwoKeyNav() {
|
||||||
|
@ -149,97 +140,89 @@ public class DataCreator {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private Entity createESTwoKeyNavEntity(int propertyInt16, String propertyString) {
|
private Entity createESTwoKeyNavEntity(int propertyInt16, String propertyString) {
|
||||||
return new EntityImpl()
|
return new EntityImpl()
|
||||||
.addProperty(createPrimitive("PropertyInt16", propertyInt16))
|
.addProperty(createPrimitive("PropertyInt16", propertyInt16))
|
||||||
.addProperty(createPrimitive("PropertyString", propertyString))
|
.addProperty(createPrimitive("PropertyString", propertyString))
|
||||||
.addProperty(createComplex("PropertyComp",
|
.addProperty(createComplex("PropertyComp",
|
||||||
createPrimitive("PropertyInt16", 11),
|
createPrimitive("PropertyInt16", 11),
|
||||||
createComplex("PropertyComp",
|
createComplex("PropertyComp",
|
||||||
createPrimitive("PropertyString", "StringValue"),
|
createPrimitive("PropertyString", "StringValue"),
|
||||||
createPrimitive("PropertyBinary", new byte[] { 1, 35, 69, 103, -119, -85, -51, -17 }),
|
createPrimitive("PropertyBinary", new byte[] { 1, 35, 69, 103, -119, -85, -51, -17 }),
|
||||||
createPrimitive("PropertyBoolean", true),
|
createPrimitive("PropertyBoolean", true),
|
||||||
createPrimitive("PropertyByte", 255),
|
createPrimitive("PropertyByte", 255),
|
||||||
createPrimitive("PropertyDate", getDateTime(2012, 12, 3, 7, 16, 23)),
|
createPrimitive("PropertyDate", getDateTime(2012, 12, 3, 7, 16, 23)),
|
||||||
createPrimitive("PropertyDecimal", 34),
|
createPrimitive("PropertyDecimal", 34),
|
||||||
createPrimitive("PropertySingle", 179000000000000000000D),
|
createPrimitive("PropertySingle", 179000000000000000000D),
|
||||||
createPrimitive("PropertyDouble", -179000000000000000000D),
|
createPrimitive("PropertyDouble", -179000000000000000000D),
|
||||||
createPrimitive("PropertyDuration", 6),
|
createPrimitive("PropertyDuration", 6),
|
||||||
createPrimitive("PropertyGuid", UUID.fromString("01234567-89ab-cdef-0123-456789abcdef")),
|
createPrimitive("PropertyGuid", UUID.fromString("01234567-89ab-cdef-0123-456789abcdef")),
|
||||||
createPrimitive("PropertyInt16", Short.MAX_VALUE),
|
createPrimitive("PropertyInt16", Short.MAX_VALUE),
|
||||||
createPrimitive("PropertyInt32", Integer.MAX_VALUE),
|
createPrimitive("PropertyInt32", Integer.MAX_VALUE),
|
||||||
createPrimitive("PropertyInt64", Long.MAX_VALUE),
|
createPrimitive("PropertyInt64", Long.MAX_VALUE),
|
||||||
createPrimitive("PropertySByte", Byte.MAX_VALUE),
|
createPrimitive("PropertySByte", Byte.MAX_VALUE),
|
||||||
createPrimitive("PropertyTimeOfDay", getTime(21, 5, 59))
|
createPrimitive("PropertyTimeOfDay", getTime(21, 5, 59)))))
|
||||||
)
|
.addProperty(createComplex("PropertyCompNav",
|
||||||
))
|
createPrimitive("PropertyInt16", 1),
|
||||||
.addProperty(new PropertyImpl(null, "PropertyCompNav", ValueType.COMPLEX, createCTPrimCompValue(1)))
|
createKeyNavAllPrimComplexValue("PropertyComp")))
|
||||||
.addProperty(new PropertyImpl(null, "CollPropertyComp", ValueType.COLLECTION_COMPLEX,
|
.addProperty(createComplexCollection("CollPropertyComp"))
|
||||||
new ArrayList<ComplexValue>()))
|
.addProperty(createComplexCollection("CollPropertyCompNav",
|
||||||
.addProperty(createComplexCollection("CollPropertyCompNav",
|
Arrays.asList(createPrimitive("PropertyInt16", 1))))
|
||||||
Arrays.asList(createPrimitive("PropertyInt16", 1))))
|
.addProperty(createPrimitiveCollection("CollPropertyString", 1, 2))
|
||||||
.addProperty(createPrimitiveCollection("CollPropertyString", 1, 2))
|
.addProperty(createComplex("PropertyCompTwoPrim",
|
||||||
.addProperty(createComplex("PropertyCompTwoPrim",
|
createPrimitive("PropertyInt16", 11),
|
||||||
createPrimitive("PropertyInt16", 11),
|
createPrimitive("PropertyString", "11")));
|
||||||
createPrimitive("PropertyString", "11")
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ComplexValue createKeyNavAllPrimComplexValue() {
|
private Property createKeyNavAllPrimComplexValue(final String name) {
|
||||||
ComplexValue cvAllPrim;
|
return createComplex(name,
|
||||||
cvAllPrim = new ComplexValueImpl();
|
createPrimitive("PropertyString", "First Resource - positive values"),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyString", "First Resource - positive values"));
|
createPrimitive("PropertyBinary", new byte[] { 1, 35, 69, 103, -119, -85, -51, -17 }),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyBinary", new byte[] { 1, 35, 69, 103, -119, -85, -51, -17 } ));
|
createPrimitive("PropertyBoolean", true),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyBoolean", true));
|
createPrimitive("PropertyByte", 255),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyByte", 255));
|
createPrimitive("PropertyDate", getDateTime(2012, 12, 3, 7, 16, 23)),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyDate", getDateTime(2012, 12, 3, 7, 16, 23)));
|
createPrimitive("PropertyDateTimeOffset", getTimestamp(2012, 12, 3, 7, 16, 23, 0)),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyDateTimeOffset", getTimestamp(2012, 12, 3, 7, 16, 23, 0)));
|
createPrimitive("PropertyDecimal", 34),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyDecimal", 34));
|
createPrimitive("PropertySingle", 179000000000000000000D),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertySingle", 179000000000000000000D));
|
createPrimitive("PropertyDouble", -179000000000000000000D),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyDouble", -179000000000000000000D));
|
createPrimitive("PropertyDuration", 6),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyDuration", 6));
|
createPrimitive("PropertyGuid", UUID.fromString("01234567-89ab-cdef-0123-456789abcdef")),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyGuid", UUID.fromString("01234567-89ab-cdef-0123-456789abcdef")));
|
createPrimitive("PropertyInt16", Short.MAX_VALUE),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyInt16", Short.MAX_VALUE));
|
createPrimitive("PropertyInt32", Integer.MAX_VALUE),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyInt32", Integer.MAX_VALUE));
|
createPrimitive("PropertyInt64", Long.MAX_VALUE),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyInt64", Long.MAX_VALUE));
|
createPrimitive("PropertySByte", Byte.MAX_VALUE),
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertySByte", Byte.MAX_VALUE));
|
createPrimitive("PropertyTimeOfDay", getTime(21, 5, 59)));
|
||||||
cvAllPrim.getValue().add(createPrimitive("PropertyTimeOfDay", getTime(21, 5, 59)));
|
|
||||||
|
|
||||||
return cvAllPrim;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private EntitySet createESCompCollComp() {
|
private EntitySet createESCompCollComp() {
|
||||||
final EntitySet entitySet = new EntitySetImpl();
|
final EntitySet entitySet = new EntitySetImpl();
|
||||||
|
|
||||||
entitySet.getEntities().add(new EntityImpl()
|
entitySet.getEntities().add(new EntityImpl()
|
||||||
.addProperty(createPrimitive("PropertyInt16", Short.MAX_VALUE))
|
.addProperty(createPrimitive("PropertyInt16", Short.MAX_VALUE))
|
||||||
.addProperty(createComplex("PropertyComp",
|
.addProperty(createComplex("PropertyComp",
|
||||||
createComplexCollection("CollPropertyComp",
|
createComplexCollection("CollPropertyComp",
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 555),
|
createPrimitive("PropertyInt16", 555),
|
||||||
createPrimitive("PropertyString", "1 Test Complex in Complex Property")),
|
createPrimitive("PropertyString", "1 Test Complex in Complex Property")),
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 666),
|
createPrimitive("PropertyInt16", 666),
|
||||||
createPrimitive("PropertyString", "2 Test Complex in Complex Property")),
|
createPrimitive("PropertyString", "2 Test Complex in Complex Property")),
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 777),
|
createPrimitive("PropertyInt16", 777),
|
||||||
createPrimitive("PropertyString", "3 Test Complex in Complex Property"))
|
createPrimitive("PropertyString", "3 Test Complex in Complex Property"))))));
|
||||||
))));
|
|
||||||
|
|
||||||
entitySet.getEntities().add(new EntityImpl()
|
entitySet.getEntities().add(new EntityImpl()
|
||||||
.addProperty(createPrimitive("PropertyInt16", 12345))
|
.addProperty(createPrimitive("PropertyInt16", 12345))
|
||||||
.addProperty(createComplex("PropertyComp",
|
.addProperty(createComplex("PropertyComp",
|
||||||
createComplexCollection("CollPropertyComp",
|
createComplexCollection("CollPropertyComp",
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 888),
|
createPrimitive("PropertyInt16", 888),
|
||||||
createPrimitive("PropertyString", "11 Test Complex in Complex Property")),
|
createPrimitive("PropertyString", "11 Test Complex in Complex Property")),
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 999),
|
createPrimitive("PropertyInt16", 999),
|
||||||
createPrimitive("PropertyString", "12 Test Complex in Complex Property")),
|
createPrimitive("PropertyString", "12 Test Complex in Complex Property")),
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 0),
|
createPrimitive("PropertyInt16", 0),
|
||||||
createPrimitive("PropertyString", "13 Test Complex in Complex Property"))
|
createPrimitive("PropertyString", "13 Test Complex in Complex Property"))))));
|
||||||
))));
|
|
||||||
|
|
||||||
return entitySet;
|
return entitySet;
|
||||||
}
|
}
|
||||||
|
@ -451,42 +434,40 @@ public class DataCreator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntitySet createESMixPrimCollComp() {
|
private EntitySet createESMixPrimCollComp() {
|
||||||
EntitySet entitySet = new EntitySetImpl();
|
|
||||||
|
|
||||||
Entity entity = new EntityImpl();
|
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", Short.MAX_VALUE));
|
|
||||||
entity.addProperty(createPrimitiveCollection("CollPropertyString",
|
|
||||||
"Employee1@company.example", "Employee2@company.example", "Employee3@company.example"));
|
|
||||||
entity.addProperty(createComplex("PropertyComp",
|
|
||||||
createPrimitive("PropertyInt16", 111),
|
|
||||||
createPrimitive("PropertyString", "TEST A")));
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final Property complexCollection = createComplexCollection("CollPropertyComp",
|
final Property complexCollection = createComplexCollection("CollPropertyComp",
|
||||||
Arrays.asList(createPrimitive("PropertyInt16", 123), createPrimitive("PropertyString", "TEST 1")),
|
Arrays.asList(createPrimitive("PropertyInt16", 123), createPrimitive("PropertyString", "TEST 1")),
|
||||||
Arrays.asList(createPrimitive("PropertyInt16", 456), createPrimitive("PropertyString", "TEST 2")),
|
Arrays.asList(createPrimitive("PropertyInt16", 456), createPrimitive("PropertyString", "TEST 2")),
|
||||||
Arrays.asList(createPrimitive("PropertyInt16", 789), createPrimitive("PropertyString", "TEST 3")));
|
Arrays.asList(createPrimitive("PropertyInt16", 789), createPrimitive("PropertyString", "TEST 3")));
|
||||||
entity.addProperty(complexCollection);
|
|
||||||
entitySet.getEntities().add(entity);
|
|
||||||
|
|
||||||
entity = new EntityImpl();
|
EntitySet entitySet = new EntitySetImpl();
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", 7));
|
|
||||||
entity.addProperty(createPrimitiveCollection("CollPropertyString",
|
|
||||||
"Employee1@company.example", "Employee2@company.example", "Employee3@company.example"));
|
|
||||||
entity.addProperty(createComplex("PropertyComp",
|
|
||||||
createPrimitive("PropertyInt16", 222),
|
|
||||||
createPrimitive("PropertyString", "TEST B")));
|
|
||||||
entity.addProperty(complexCollection);
|
|
||||||
entitySet.getEntities().add(entity);
|
|
||||||
|
|
||||||
entity = new EntityImpl();
|
entitySet.getEntities().add(new EntityImpl()
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", 0));
|
.addProperty(createPrimitive("PropertyInt16", Short.MAX_VALUE))
|
||||||
entity.addProperty(createPrimitiveCollection("CollPropertyString",
|
.addProperty(createPrimitiveCollection("CollPropertyString",
|
||||||
"Employee1@company.example", "Employee2@company.example", "Employee3@company.example"));
|
"Employee1@company.example", "Employee2@company.example", "Employee3@company.example"))
|
||||||
entity.addProperty(createComplex("PropertyComp",
|
.addProperty(createComplex("PropertyComp",
|
||||||
createPrimitive("PropertyInt16", 333),
|
createPrimitive("PropertyInt16", 111),
|
||||||
createPrimitive("PropertyString", "TEST C")));
|
createPrimitive("PropertyString", "TEST A")))
|
||||||
entity.addProperty(complexCollection);
|
.addProperty(complexCollection));
|
||||||
entitySet.getEntities().add(entity);
|
|
||||||
|
entitySet.getEntities().add(new EntityImpl()
|
||||||
|
.addProperty(createPrimitive("PropertyInt16", 7))
|
||||||
|
.addProperty(createPrimitiveCollection("CollPropertyString",
|
||||||
|
"Employee1@company.example", "Employee2@company.example", "Employee3@company.example"))
|
||||||
|
.addProperty(createComplex("PropertyComp",
|
||||||
|
createPrimitive("PropertyInt16", 222),
|
||||||
|
createPrimitive("PropertyString", "TEST B")))
|
||||||
|
.addProperty(complexCollection));
|
||||||
|
|
||||||
|
entitySet.getEntities().add(new EntityImpl()
|
||||||
|
.addProperty(createPrimitive("PropertyInt16", 0))
|
||||||
|
.addProperty(createPrimitiveCollection("CollPropertyString",
|
||||||
|
"Employee1@company.example", "Employee2@company.example", "Employee3@company.example"))
|
||||||
|
.addProperty(createComplex("PropertyComp",
|
||||||
|
createPrimitive("PropertyInt16", 333),
|
||||||
|
createPrimitive("PropertyString", "TEST C")))
|
||||||
|
.addProperty(complexCollection));
|
||||||
|
|
||||||
return entitySet;
|
return entitySet;
|
||||||
}
|
}
|
||||||
|
@ -552,27 +533,27 @@ public class DataCreator {
|
||||||
private EntitySet createESMedia() {
|
private EntitySet createESMedia() {
|
||||||
EntitySet entitySet = new EntitySetImpl();
|
EntitySet entitySet = new EntitySetImpl();
|
||||||
|
|
||||||
Entity entity = new EntityImpl();
|
Entity entity = new EntityImpl()
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", 1));
|
.addProperty(createPrimitive("PropertyInt16", 1))
|
||||||
entity.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("darkturquoise")));
|
.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("darkturquoise")));
|
||||||
entity.setMediaContentType("image/svg+xml");
|
entity.setMediaContentType("image/svg+xml");
|
||||||
entitySet.getEntities().add(entity);
|
entitySet.getEntities().add(entity);
|
||||||
|
|
||||||
entity = new EntityImpl();
|
entity = new EntityImpl()
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", 2));
|
.addProperty(createPrimitive("PropertyInt16", 2))
|
||||||
entity.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("royalblue")));
|
.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("royalblue")));
|
||||||
entity.setMediaContentType("image/svg+xml");
|
entity.setMediaContentType("image/svg+xml");
|
||||||
entitySet.getEntities().add(entity);
|
entitySet.getEntities().add(entity);
|
||||||
|
|
||||||
entity = new EntityImpl();
|
entity = new EntityImpl()
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", 3));
|
.addProperty(createPrimitive("PropertyInt16", 3))
|
||||||
entity.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("crimson")));
|
.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("crimson")));
|
||||||
entity.setMediaContentType("image/svg+xml");
|
entity.setMediaContentType("image/svg+xml");
|
||||||
entitySet.getEntities().add(entity);
|
entitySet.getEntities().add(entity);
|
||||||
|
|
||||||
entity = new EntityImpl();
|
entity = new EntityImpl()
|
||||||
entity.addProperty(createPrimitive("PropertyInt16", 4));
|
.addProperty(createPrimitive("PropertyInt16", 4))
|
||||||
entity.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("black")));
|
.addProperty(createPrimitive(DataProvider.MEDIA_PROPERTY_NAME, createImage("black")));
|
||||||
entity.setMediaContentType("image/svg+xml");
|
entity.setMediaContentType("image/svg+xml");
|
||||||
entitySet.getEntities().add(entity);
|
entitySet.getEntities().add(entity);
|
||||||
|
|
||||||
|
@ -581,18 +562,19 @@ public class DataCreator {
|
||||||
|
|
||||||
private byte[] createImage(final String color) {
|
private byte[] createImage(final String color) {
|
||||||
return ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
return ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 100 100\">\n"
|
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 100 100\">\n"
|
||||||
+ " <g stroke=\"darkmagenta\" stroke-width=\"16\" fill=\"" + color + "\">\n"
|
+ " <g stroke=\"darkmagenta\" stroke-width=\"16\" fill=\"" + color + "\">\n"
|
||||||
+ " <circle cx=\"50\" cy=\"50\" r=\"42\"/>\n"
|
+ " <circle cx=\"50\" cy=\"50\" r=\"42\"/>\n"
|
||||||
+ " </g>\n"
|
+ " </g>\n"
|
||||||
+ "</svg>\n").getBytes(Charset.forName("UTF-8"));
|
+ "</svg>\n").getBytes(Charset.forName("UTF-8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void linkESTwoPrim(Map<String, EntitySet> data) {
|
private void linkESTwoPrim(Map<String, EntitySet> data) {
|
||||||
final EntitySet entitySet = data.get("ESTwoPrim");
|
final EntitySet entitySet = data.get("ESTwoPrim");
|
||||||
final List<Entity> targetEntities = data.get("ESAllPrim").getEntities();
|
final List<Entity> targetEntities = data.get("ESAllPrim").getEntities();
|
||||||
|
|
||||||
setLinks(entitySet.getEntities().get(1), "NavPropertyETAllPrimMany", targetEntities.subList(1, 3));
|
setLinks(entitySet.getEntities().get(1), "NavPropertyETAllPrimMany",
|
||||||
|
targetEntities.get(1), targetEntities.get(2));
|
||||||
|
|
||||||
setLink(entitySet.getEntities().get(3), "NavPropertyETAllPrimOne", targetEntities.get(0));
|
setLink(entitySet.getEntities().get(3), "NavPropertyETAllPrimOne", targetEntities.get(0));
|
||||||
}
|
}
|
||||||
|
@ -601,14 +583,13 @@ public class DataCreator {
|
||||||
final EntitySet entitySet = data.get("ESAllPrim");
|
final EntitySet entitySet = data.get("ESAllPrim");
|
||||||
final List<Entity> targetEntities = data.get("ESTwoPrim").getEntities();
|
final List<Entity> targetEntities = data.get("ESTwoPrim").getEntities();
|
||||||
|
|
||||||
setLinks(entitySet.getEntities().get(0), "NavPropertyETTwoPrimMany", targetEntities.subList(1, 2));
|
setLinks(entitySet.getEntities().get(0), "NavPropertyETTwoPrimMany", targetEntities.get(1));
|
||||||
setLink(entitySet.getEntities().get(0), "NavPropertyETTwoPrimOne", targetEntities.get(3));
|
setLink(entitySet.getEntities().get(0), "NavPropertyETTwoPrimOne", targetEntities.get(3));
|
||||||
|
|
||||||
setLinks(entitySet.getEntities().get(2), "NavPropertyETTwoPrimMany",
|
setLinks(entitySet.getEntities().get(2), "NavPropertyETTwoPrimMany",
|
||||||
Arrays.asList(targetEntities.get(0), targetEntities.get(2), targetEntities.get(3)));
|
targetEntities.get(0), targetEntities.get(2), targetEntities.get(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void linkESKeyNav(Map<String, EntitySet> data) {
|
private void linkESKeyNav(Map<String, EntitySet> data) {
|
||||||
final EntitySet entitySet = data.get("ESKeyNav");
|
final EntitySet entitySet = data.get("ESKeyNav");
|
||||||
final List<Entity> esKeyNavTargets = data.get("ESKeyNav").getEntities();
|
final List<Entity> esKeyNavTargets = data.get("ESKeyNav").getEntities();
|
||||||
|
@ -616,8 +597,10 @@ public class DataCreator {
|
||||||
final List<Entity> esMediaTargets = data.get("ESMedia").getEntities();
|
final List<Entity> esMediaTargets = data.get("ESMedia").getEntities();
|
||||||
|
|
||||||
// NavPropertyETKeyNavMany
|
// NavPropertyETKeyNavMany
|
||||||
setLinks(entitySet.getEntities().get(0), "NavPropertyETKeyNavMany", esKeyNavTargets.subList(0, 2));
|
setLinks(entitySet.getEntities().get(0), "NavPropertyETKeyNavMany",
|
||||||
setLinks(entitySet.getEntities().get(1), "NavPropertyETKeyNavMany", esKeyNavTargets.subList(1, 3));
|
esKeyNavTargets.get(0), esKeyNavTargets.get(1));
|
||||||
|
setLinks(entitySet.getEntities().get(1), "NavPropertyETKeyNavMany",
|
||||||
|
esKeyNavTargets.get(1), esKeyNavTargets.get(2));
|
||||||
|
|
||||||
// NavPropertyETKeyNavOne
|
// NavPropertyETKeyNavOne
|
||||||
setLink(entitySet.getEntities().get(0), "NavPropertyETKeyNavOne", esKeyNavTargets.get(1));
|
setLink(entitySet.getEntities().get(0), "NavPropertyETKeyNavOne", esKeyNavTargets.get(1));
|
||||||
|
@ -629,9 +612,10 @@ public class DataCreator {
|
||||||
setLink(entitySet.getEntities().get(2), "NavPropertyETTwoKeyNavOne", esTwoKeyNavTargets.get(2));
|
setLink(entitySet.getEntities().get(2), "NavPropertyETTwoKeyNavOne", esTwoKeyNavTargets.get(2));
|
||||||
|
|
||||||
// NavPropertyETTwoKeyNavMany
|
// NavPropertyETTwoKeyNavMany
|
||||||
setLinks(entitySet.getEntities().get(0), "NavPropertyETTwoKeyNavMany", esTwoKeyNavTargets.subList(0, 2));
|
setLinks(entitySet.getEntities().get(0), "NavPropertyETTwoKeyNavMany",
|
||||||
setLinks(entitySet.getEntities().get(1), "NavPropertyETTwoKeyNavMany", esTwoKeyNavTargets.subList(2, 3));
|
esTwoKeyNavTargets.get(0), esTwoKeyNavTargets.get(1));
|
||||||
setLinks(entitySet.getEntities().get(2), "NavPropertyETTwoKeyNavMany", esTwoKeyNavTargets.subList(3, 4));
|
setLinks(entitySet.getEntities().get(1), "NavPropertyETTwoKeyNavMany", esTwoKeyNavTargets.get(2));
|
||||||
|
setLinks(entitySet.getEntities().get(2), "NavPropertyETTwoKeyNavMany", esTwoKeyNavTargets.get(3));
|
||||||
|
|
||||||
// NavPropertyETMediaOne
|
// NavPropertyETMediaOne
|
||||||
setLink(entitySet.getEntities().get(0), "NavPropertyETMediaOne", esMediaTargets.get(0));
|
setLink(entitySet.getEntities().get(0), "NavPropertyETMediaOne", esMediaTargets.get(0));
|
||||||
|
@ -639,7 +623,6 @@ public class DataCreator {
|
||||||
setLink(entitySet.getEntities().get(2), "NavPropertyETMediaOne", esMediaTargets.get(2));
|
setLink(entitySet.getEntities().get(2), "NavPropertyETMediaOne", esMediaTargets.get(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void linkESTwoKeyNav(Map<String, EntitySet> data) {
|
private void linkESTwoKeyNav(Map<String, EntitySet> data) {
|
||||||
final EntitySet entitySet = data.get("ESTwoKeyNav");
|
final EntitySet entitySet = data.get("ESTwoKeyNav");
|
||||||
final List<Entity> esKeyNavTargets = data.get("ESKeyNav").getEntities();
|
final List<Entity> esKeyNavTargets = data.get("ESKeyNav").getEntities();
|
||||||
|
@ -652,9 +635,12 @@ public class DataCreator {
|
||||||
setLink(entitySet.getEntities().get(3), "NavPropertyETKeyNavOne", esKeyNavTargets.get(2));
|
setLink(entitySet.getEntities().get(3), "NavPropertyETKeyNavOne", esKeyNavTargets.get(2));
|
||||||
|
|
||||||
// NavPropertyETKeyNavMany
|
// NavPropertyETKeyNavMany
|
||||||
setLinks(entitySet.getEntities().get(0), "NavPropertyETKeyNavMany", esKeyNavTargets.subList(0, 2));
|
setLinks(entitySet.getEntities().get(0), "NavPropertyETKeyNavMany",
|
||||||
setLinks(entitySet.getEntities().get(1), "NavPropertyETKeyNavMany", esKeyNavTargets.subList(0, 2));
|
esKeyNavTargets.get(0), esKeyNavTargets.get(1));
|
||||||
setLinks(entitySet.getEntities().get(2), "NavPropertyETKeyNavMany", esKeyNavTargets.subList(1, 3));
|
setLinks(entitySet.getEntities().get(1), "NavPropertyETKeyNavMany",
|
||||||
|
esKeyNavTargets.get(0), esKeyNavTargets.get(1));
|
||||||
|
setLinks(entitySet.getEntities().get(2), "NavPropertyETKeyNavMany",
|
||||||
|
esKeyNavTargets.get(1), esKeyNavTargets.get(2));
|
||||||
|
|
||||||
// NavPropertyETTwoKeyNavOne
|
// NavPropertyETTwoKeyNavOne
|
||||||
setLink(entitySet.getEntities().get(0), "NavPropertyETTwoKeyNavOne", esTwoKeyNavTargets.get(0));
|
setLink(entitySet.getEntities().get(0), "NavPropertyETTwoKeyNavOne", esTwoKeyNavTargets.get(0));
|
||||||
|
@ -662,12 +648,12 @@ public class DataCreator {
|
||||||
setLink(entitySet.getEntities().get(3), "NavPropertyETTwoKeyNavOne", esTwoKeyNavTargets.get(2));
|
setLink(entitySet.getEntities().get(3), "NavPropertyETTwoKeyNavOne", esTwoKeyNavTargets.get(2));
|
||||||
|
|
||||||
// NavPropertyETTwoKeyNavMany
|
// NavPropertyETTwoKeyNavMany
|
||||||
setLinks(entitySet.getEntities().get(0), "NavPropertyETTwoKeyNavMany", esKeyNavTargets.subList(0, 2));
|
setLinks(entitySet.getEntities().get(0), "NavPropertyETTwoKeyNavMany",
|
||||||
setLinks(entitySet.getEntities().get(1), "NavPropertyETTwoKeyNavMany", esKeyNavTargets.subList(0, 1));
|
esKeyNavTargets.get(0), esKeyNavTargets.get(1));
|
||||||
setLinks(entitySet.getEntities().get(2), "NavPropertyETTwoKeyNavMany", esKeyNavTargets.subList(1, 2));
|
setLinks(entitySet.getEntities().get(1), "NavPropertyETTwoKeyNavMany", esKeyNavTargets.get(0));
|
||||||
|
setLinks(entitySet.getEntities().get(2), "NavPropertyETTwoKeyNavMany", esKeyNavTargets.get(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected static Property createPrimitive(final String name, final Object value) {
|
protected static Property createPrimitive(final String name, final Object value) {
|
||||||
return new PropertyImpl(null, name, ValueType.PRIMITIVE, value);
|
return new PropertyImpl(null, name, ValueType.PRIMITIVE, value);
|
||||||
}
|
}
|
||||||
|
@ -719,18 +705,28 @@ public class DataCreator {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void setLink(Entity entity, final String navigationPropertyName, final Entity target) {
|
protected static void setLink(Entity entity, final String navigationPropertyName, final Entity target) {
|
||||||
Link link = new LinkImpl();
|
Link link = entity.getNavigationLink(navigationPropertyName);
|
||||||
link.setTitle(navigationPropertyName);
|
if (link == null) {
|
||||||
|
link = new LinkImpl();
|
||||||
|
link.setType(ODataLinkType.ENTITY_NAVIGATION.toString());
|
||||||
|
link.setTitle(navigationPropertyName);
|
||||||
|
entity.getNavigationLinks().add(link);
|
||||||
|
}
|
||||||
link.setInlineEntity(target);
|
link.setInlineEntity(target);
|
||||||
entity.getNavigationLinks().add(link);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void setLinks(Entity entity, final String navigationPropertyName, final List<Entity> targets) {
|
protected static void setLinks(Entity entity, final String navigationPropertyName, final Entity... targets) {
|
||||||
Link link = new LinkImpl();
|
Link link = entity.getNavigationLink(navigationPropertyName);
|
||||||
link.setTitle(navigationPropertyName);
|
if (link == null) {
|
||||||
EntitySet target = new EntitySetImpl();
|
link = new LinkImpl();
|
||||||
target.getEntities().addAll(targets);
|
link.setType(ODataLinkType.ENTITY_SET_NAVIGATION.toString());
|
||||||
link.setInlineEntitySet(target);
|
link.setTitle(navigationPropertyName);
|
||||||
entity.getNavigationLinks().add(link);
|
EntitySet target = new EntitySetImpl();
|
||||||
|
target.getEntities().addAll(Arrays.asList(targets));
|
||||||
|
link.setInlineEntitySet(target);
|
||||||
|
entity.getNavigationLinks().add(link);
|
||||||
|
} else {
|
||||||
|
link.getInlineEntitySet().getEntities().addAll(Arrays.asList(targets));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,12 +31,11 @@ import org.apache.olingo.commons.api.data.Entity;
|
||||||
import org.apache.olingo.commons.api.data.EntitySet;
|
import org.apache.olingo.commons.api.data.EntitySet;
|
||||||
import org.apache.olingo.commons.api.data.Link;
|
import org.apache.olingo.commons.api.data.Link;
|
||||||
import org.apache.olingo.commons.api.data.Property;
|
import org.apache.olingo.commons.api.data.Property;
|
||||||
import org.apache.olingo.commons.api.domain.ODataLinkType;
|
|
||||||
import org.apache.olingo.commons.api.edm.Edm;
|
import org.apache.olingo.commons.api.edm.Edm;
|
||||||
import org.apache.olingo.commons.api.edm.EdmBindingTarget;
|
|
||||||
import org.apache.olingo.commons.api.edm.EdmComplexType;
|
import org.apache.olingo.commons.api.edm.EdmComplexType;
|
||||||
import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
||||||
import org.apache.olingo.commons.api.edm.EdmEntityType;
|
import org.apache.olingo.commons.api.edm.EdmEntityType;
|
||||||
|
import org.apache.olingo.commons.api.edm.EdmFunction;
|
||||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
|
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
|
||||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
|
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
|
||||||
|
@ -45,8 +44,6 @@ import org.apache.olingo.commons.api.edm.EdmStructuredType;
|
||||||
import org.apache.olingo.commons.api.edm.EdmType;
|
import org.apache.olingo.commons.api.edm.EdmType;
|
||||||
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
||||||
import org.apache.olingo.commons.core.data.EntityImpl;
|
import org.apache.olingo.commons.core.data.EntityImpl;
|
||||||
import org.apache.olingo.commons.core.data.EntitySetImpl;
|
|
||||||
import org.apache.olingo.commons.core.data.LinkImpl;
|
|
||||||
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt16;
|
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt16;
|
||||||
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32;
|
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32;
|
||||||
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt64;
|
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt64;
|
||||||
|
@ -59,7 +56,6 @@ import org.apache.olingo.server.api.uri.UriParameter;
|
||||||
public class DataProvider {
|
public class DataProvider {
|
||||||
|
|
||||||
protected static final String MEDIA_PROPERTY_NAME = "$value";
|
protected static final String MEDIA_PROPERTY_NAME = "$value";
|
||||||
// private static final String KEY_NAME = "PropertyInt16";
|
|
||||||
|
|
||||||
final private Map<String, EntitySet> data;
|
final private Map<String, EntitySet> data;
|
||||||
private Edm edm;
|
private Edm edm;
|
||||||
|
@ -133,37 +129,6 @@ public class DataProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public Entity create(final EdmEntitySet edmEntitySet) throws DataProviderException {
|
|
||||||
// final EdmEntityType edmEntityType = edmEntitySet.getEntityType();
|
|
||||||
// List<Entity> entities = readAll(edmEntitySet).getEntities();
|
|
||||||
// Entity entity = new EntityImpl();
|
|
||||||
// final List<String> keyNames = edmEntityType.getKeyPredicateNames();
|
|
||||||
// if (keyNames.size() == 1 && keyNames.get(0).equals(KEY_NAME)) {
|
|
||||||
// entity.addProperty(DataCreator.createPrimitive(KEY_NAME, findFreeKeyValue(entities)));
|
|
||||||
// } else {
|
|
||||||
// throw new DataProviderException("Key construction not supported!");
|
|
||||||
// }
|
|
||||||
// createProperties(edmEntityType, entity.getProperties());
|
|
||||||
// entities.add(entity);
|
|
||||||
// return entity;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private Integer findFreeKeyValue(final List<Entity> entities) {
|
|
||||||
// Integer result = 0;
|
|
||||||
// boolean free;
|
|
||||||
// do {
|
|
||||||
// ++result;
|
|
||||||
// free = true;
|
|
||||||
// for (final Entity entity : entities) {
|
|
||||||
// if (result.equals(entity.getProperty(KEY_NAME).getValue())) {
|
|
||||||
// free = false;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } while (!free);
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public Entity create(final EdmEntitySet edmEntitySet) throws DataProviderException {
|
public Entity create(final EdmEntitySet edmEntitySet) throws DataProviderException {
|
||||||
final EdmEntityType edmEntityType = edmEntitySet.getEntityType();
|
final EdmEntityType edmEntityType = edmEntitySet.getEntityType();
|
||||||
final EntitySet entitySet = readAll(edmEntitySet);
|
final EntitySet entitySet = readAll(edmEntitySet);
|
||||||
|
@ -253,8 +218,7 @@ public class DataProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(final String rawBaseUri, final EdmEntitySet edmEntitySet, Entity entity,
|
public void update(final String rawBaseUri, final EdmEntitySet edmEntitySet, Entity entity,
|
||||||
final Entity changedEntity, final boolean patch,
|
final Entity changedEntity, final boolean patch, final boolean isInsert) throws DataProviderException {
|
||||||
final boolean isInsert) throws DataProviderException {
|
|
||||||
|
|
||||||
final EdmEntityType entityType = edmEntitySet.getEntityType();
|
final EdmEntityType entityType = edmEntitySet.getEntityType();
|
||||||
final List<String> keyNames = entityType.getKeyPredicateNames();
|
final List<String> keyNames = entityType.getKeyPredicateNames();
|
||||||
|
@ -320,8 +284,7 @@ public class DataProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleDeepInsert(final String rawBaseUri, final EdmEntitySet edmEntitySet, final Entity entity,
|
private void handleDeepInsert(final String rawBaseUri, final EdmEntitySet edmEntitySet, final Entity entity,
|
||||||
final Entity changedEntity)
|
final Entity changedEntity) throws DataProviderException {
|
||||||
throws DataProviderException {
|
|
||||||
final EdmEntityType entityType = edmEntitySet.getEntityType();
|
final EdmEntityType entityType = edmEntitySet.getEntityType();
|
||||||
|
|
||||||
for (final String navPropertyName : entityType.getNavigationPropertyNames()) {
|
for (final String navPropertyName : entityType.getNavigationPropertyNames()) {
|
||||||
|
@ -331,41 +294,40 @@ public class DataProvider {
|
||||||
// Deep inserts are not allowed in update operations, so we can be sure, that we do not override
|
// Deep inserts are not allowed in update operations, so we can be sure, that we do not override
|
||||||
// a navigation link!
|
// a navigation link!
|
||||||
final EdmNavigationProperty navigationProperty = entityType.getNavigationProperty(navPropertyName);
|
final EdmNavigationProperty navigationProperty = entityType.getNavigationProperty(navPropertyName);
|
||||||
final EdmBindingTarget target = edmEntitySet.getRelatedBindingTarget(navPropertyName);
|
final EdmEntitySet target = (EdmEntitySet) edmEntitySet.getRelatedBindingTarget(navPropertyName);
|
||||||
final EdmEntityType inlineEntityType = navigationProperty.getType();
|
|
||||||
|
|
||||||
if (navigationProperty.isCollection()) {
|
if (navigationProperty.isCollection()) {
|
||||||
final List<Entity> entities =
|
final List<Entity> entities =
|
||||||
createInlineEntities(rawBaseUri, target, inlineEntityType, navigationLink.getInlineEntitySet());
|
createInlineEntities(rawBaseUri, target, navigationLink.getInlineEntitySet());
|
||||||
|
|
||||||
for (final Entity inlineEntity : entities) {
|
for (final Entity inlineEntity : entities) {
|
||||||
createLink(navigationProperty, entity, inlineEntity);
|
createLink(navigationProperty, entity, inlineEntity);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final Entity inlineEntity =
|
final Entity inlineEntity =
|
||||||
createInlineEntity(rawBaseUri, target, inlineEntityType, navigationLink.getInlineEntity());
|
createInlineEntity(rawBaseUri, target, navigationLink.getInlineEntity());
|
||||||
createLink(navigationProperty, entity, inlineEntity);
|
createLink(navigationProperty, entity, inlineEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Entity> createInlineEntities(final String rawBaseUri, final EdmBindingTarget target,
|
private List<Entity> createInlineEntities(final String rawBaseUri, final EdmEntitySet targetEntitySet,
|
||||||
final EdmEntityType type, final EntitySet changedEntitySet) throws DataProviderException {
|
final EntitySet changedEntitySet) throws DataProviderException {
|
||||||
List<Entity> entities = new ArrayList<Entity>();
|
List<Entity> entities = new ArrayList<Entity>();
|
||||||
|
|
||||||
for (final Entity newEntity : changedEntitySet.getEntities()) {
|
for (final Entity newEntity : changedEntitySet.getEntities()) {
|
||||||
entities.add(createInlineEntity(rawBaseUri, target, type, newEntity));
|
entities.add(createInlineEntity(rawBaseUri, targetEntitySet, newEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
return entities;
|
return entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Entity createInlineEntity(final String rawBaseUri, final EdmBindingTarget target,
|
private Entity createInlineEntity(final String rawBaseUri, final EdmEntitySet targetEntitySet,
|
||||||
final EdmEntityType type, final Entity changedEntity) throws DataProviderException {
|
final Entity changedEntity) throws DataProviderException {
|
||||||
|
|
||||||
final Entity inlineEntity = create((EdmEntitySet) target);
|
final Entity inlineEntity = create(targetEntitySet);
|
||||||
update(rawBaseUri, (EdmEntitySet) target, inlineEntity, changedEntity, false, true);
|
update(rawBaseUri, targetEntitySet, inlineEntity, changedEntity, false, true);
|
||||||
|
|
||||||
return inlineEntity;
|
return inlineEntity;
|
||||||
}
|
}
|
||||||
|
@ -380,27 +342,11 @@ public class DataProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Duplicated code in DataCreator
|
private void setLink(final EdmNavigationProperty navigationProperty, Entity srcEntity, final Entity targetEntity) {
|
||||||
private void setLink(final EdmNavigationProperty navigationProperty, final Entity srcEntity,
|
|
||||||
final Entity destEntity) {
|
|
||||||
|
|
||||||
Link link = srcEntity.getNavigationLink(navigationProperty.getName());
|
|
||||||
if (link == null) {
|
|
||||||
link = new LinkImpl();
|
|
||||||
link.setTitle(navigationProperty.getName());
|
|
||||||
srcEntity.getNavigationLinks().add(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (navigationProperty.isCollection()) {
|
if (navigationProperty.isCollection()) {
|
||||||
if (link.getInlineEntitySet() == null) {
|
DataCreator.setLinks(srcEntity, navigationProperty.getName(), targetEntity);
|
||||||
link.setType(ODataLinkType.ENTITY_SET_NAVIGATION.toString());
|
|
||||||
link.setInlineEntitySet(new EntitySetImpl());
|
|
||||||
}
|
|
||||||
|
|
||||||
link.getInlineEntitySet().getEntities().add(destEntity);
|
|
||||||
} else {
|
} else {
|
||||||
link.setType(ODataLinkType.ENTITY_NAVIGATION.toString());
|
DataCreator.setLink(srcEntity, navigationProperty.getName(), targetEntity);
|
||||||
link.setInlineEntity(destEntity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,10 +369,8 @@ public class DataProvider {
|
||||||
} else {
|
} else {
|
||||||
final EdmComplexType type = (EdmComplexType) edmProperty.getType();
|
final EdmComplexType type = (EdmComplexType) edmProperty.getType();
|
||||||
for (final String propertyName : type.getPropertyNames()) {
|
for (final String propertyName : type.getPropertyNames()) {
|
||||||
List<Property> newProperties = null;
|
final List<Property> newProperties = newProperty == null || newProperty.asComplex() == null ? null :
|
||||||
if(newProperty != null && newProperty.asComplex() != null){
|
newProperty.asComplex().getValue();
|
||||||
newProperties = newProperty.asComplex().getValue();
|
|
||||||
}
|
|
||||||
updateProperty(type.getStructuralProperty(propertyName),
|
updateProperty(type.getStructuralProperty(propertyName),
|
||||||
findProperty(propertyName, property.asComplex().getValue()),
|
findProperty(propertyName, property.asComplex().getValue()),
|
||||||
newProperties == null ? null : findProperty(propertyName, newProperties),
|
newProperties == null ? null : findProperty(propertyName, newProperties),
|
||||||
|
@ -454,6 +398,16 @@ public class DataProvider {
|
||||||
entity.setMediaContentType(type);
|
entity.setMediaContentType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EntitySet readFunctionEntitySet(final EdmFunction function, final List<UriParameter> parameters)
|
||||||
|
throws DataProviderException {
|
||||||
|
return FunctionData.entityCollectionFunction(function.getName(), parameters, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity readFunctionEntity(final EdmFunction function, final List<UriParameter> parameters)
|
||||||
|
throws DataProviderException {
|
||||||
|
return FunctionData.entityFunction(function.getName(), parameters, data);
|
||||||
|
}
|
||||||
|
|
||||||
public void setEdm(final Edm edm) {
|
public void setEdm(final Edm edm) {
|
||||||
this.edm = edm;
|
this.edm = edm;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.olingo.server.tecsvc.data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.olingo.commons.api.data.Entity;
|
||||||
|
import org.apache.olingo.commons.api.data.EntitySet;
|
||||||
|
import org.apache.olingo.commons.core.data.EntitySetImpl;
|
||||||
|
import org.apache.olingo.server.api.uri.UriParameter;
|
||||||
|
import org.apache.olingo.server.tecsvc.data.DataProvider.DataProviderException;
|
||||||
|
|
||||||
|
public class FunctionData {
|
||||||
|
|
||||||
|
protected static EntitySet entityCollectionFunction(final String name, final List<UriParameter> parameters,
|
||||||
|
final Map<String, EntitySet> data) throws DataProviderException {
|
||||||
|
if (name.equals("UFCRTCollETTwoKeyNavParam")) {
|
||||||
|
final List<Entity> esTwoKeyNav = data.get("ESTwoKeyNav").getEntities();
|
||||||
|
EntitySet result = new EntitySetImpl();
|
||||||
|
final int endIndex = parameters.isEmpty() ? 0 : Short.valueOf(parameters.get(0).getText());
|
||||||
|
result.getEntities().addAll(
|
||||||
|
esTwoKeyNav.subList(0,
|
||||||
|
endIndex < 0 ? 0 : endIndex > esTwoKeyNav.size() ? esTwoKeyNav.size() : endIndex));
|
||||||
|
return result;
|
||||||
|
} else if (name.equals("UFCRTCollETMixPrimCollCompTwoParam")) {
|
||||||
|
return data.get("ESMixPrimCollComp");
|
||||||
|
} else if (name.equals("UFCRTCollETMedia")) {
|
||||||
|
return data.get("ESMedia");
|
||||||
|
} else {
|
||||||
|
throw new DataProviderException("Function " + name + " is not yet implemented.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static Entity entityFunction(final String name, final List<UriParameter> parameters,
|
||||||
|
final Map<String, EntitySet> data) throws DataProviderException {
|
||||||
|
final List<Entity> esTwoKeyNav = data.get("ESTwoKeyNav").getEntities();
|
||||||
|
if (name.equals("UFCRTETTwoKeyNav")) {
|
||||||
|
return esTwoKeyNav.get(0);
|
||||||
|
} else if (name.equals("UFCRTETTwoKeyNavParam")) {
|
||||||
|
final int index = parameters.isEmpty() ? 0 : Short.valueOf(parameters.get(0).getText());
|
||||||
|
return index < 0 || index >= esTwoKeyNav.size() ? null : esTwoKeyNav.get(index);
|
||||||
|
} else if (name.equals("UFCRTETMedia")) {
|
||||||
|
final int index = parameters.isEmpty() ? 1 : Short.valueOf(parameters.get(0).getText());
|
||||||
|
final List<Entity> esMedia = data.get("ESMedia").getEntities();
|
||||||
|
return index < 1 || index > esTwoKeyNav.size() ? null : esMedia.get(index - 1);
|
||||||
|
} else {
|
||||||
|
throw new DataProviderException("Function " + name + " is not yet implemented.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,6 +21,7 @@ package org.apache.olingo.server.tecsvc.processor;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.apache.olingo.commons.api.data.ContextURL;
|
import org.apache.olingo.commons.api.data.ContextURL;
|
||||||
|
import org.apache.olingo.commons.api.data.ContextURL.Builder;
|
||||||
import org.apache.olingo.commons.api.data.ContextURL.Suffix;
|
import org.apache.olingo.commons.api.data.ContextURL.Suffix;
|
||||||
import org.apache.olingo.commons.api.data.Entity;
|
import org.apache.olingo.commons.api.data.Entity;
|
||||||
import org.apache.olingo.commons.api.data.EntitySet;
|
import org.apache.olingo.commons.api.data.EntitySet;
|
||||||
|
@ -50,6 +51,7 @@ import org.apache.olingo.server.api.serializer.ODataSerializer;
|
||||||
import org.apache.olingo.server.api.serializer.SerializerException;
|
import org.apache.olingo.server.api.serializer.SerializerException;
|
||||||
import org.apache.olingo.server.api.uri.UriInfo;
|
import org.apache.olingo.server.api.uri.UriInfo;
|
||||||
import org.apache.olingo.server.api.uri.UriResourceEntitySet;
|
import org.apache.olingo.server.api.uri.UriResourceEntitySet;
|
||||||
|
import org.apache.olingo.server.api.uri.UriResourceFunction;
|
||||||
import org.apache.olingo.server.api.uri.queryoption.ExpandOption;
|
import org.apache.olingo.server.api.uri.queryoption.ExpandOption;
|
||||||
import org.apache.olingo.server.api.uri.queryoption.SelectOption;
|
import org.apache.olingo.server.api.uri.queryoption.SelectOption;
|
||||||
import org.apache.olingo.server.tecsvc.data.DataProvider;
|
import org.apache.olingo.server.tecsvc.data.DataProvider;
|
||||||
|
@ -77,6 +79,11 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
||||||
validateOptions(uriInfo.asUriInfoResource());
|
validateOptions(uriInfo.asUriInfoResource());
|
||||||
|
|
||||||
final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo.asUriInfoResource());
|
final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo.asUriInfoResource());
|
||||||
|
final EdmEntityType edmEntityType = edmEntitySet == null ?
|
||||||
|
(EdmEntityType) ((UriResourceFunction) uriInfo.getUriResourceParts()
|
||||||
|
.get(uriInfo.getUriResourceParts().size() - 1)).getType() :
|
||||||
|
edmEntitySet.getEntityType();
|
||||||
|
|
||||||
final EntitySet entitySetInitial = readEntityCollection(uriInfo);
|
final EntitySet entitySetInitial = readEntityCollection(uriInfo);
|
||||||
if (entitySetInitial == null) {
|
if (entitySetInitial == null) {
|
||||||
throw new ODataApplicationException("Nothing found.", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ROOT);
|
throw new ODataApplicationException("Nothing found.", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ROOT);
|
||||||
|
@ -102,10 +109,10 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
||||||
ODataSerializer serializer = odata.createSerializer(format);
|
ODataSerializer serializer = odata.createSerializer(format);
|
||||||
final ExpandOption expand = uriInfo.getExpandOption();
|
final ExpandOption expand = uriInfo.getExpandOption();
|
||||||
final SelectOption select = uriInfo.getSelectOption();
|
final SelectOption select = uriInfo.getSelectOption();
|
||||||
response.setContent(serializer.entityCollection(edmEntitySet.getEntityType(), entitySet,
|
response.setContent(serializer.entityCollection(edmEntityType, entitySet,
|
||||||
EntityCollectionSerializerOptions.with()
|
EntityCollectionSerializerOptions.with()
|
||||||
.contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
|
.contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
|
||||||
getContextUrl(edmEntitySet, false, expand, select))
|
getContextUrl(edmEntitySet, edmEntityType, false, expand, select))
|
||||||
.count(uriInfo.getCountOption())
|
.count(uriInfo.getCountOption())
|
||||||
.expand(expand).select(select)
|
.expand(expand).select(select)
|
||||||
.build()));
|
.build()));
|
||||||
|
@ -143,6 +150,11 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
||||||
final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
|
final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
|
||||||
validateOptions(uriInfo.asUriInfoResource());
|
validateOptions(uriInfo.asUriInfoResource());
|
||||||
final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo);
|
final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo);
|
||||||
|
final EdmEntityType edmEntityType = edmEntitySet == null ?
|
||||||
|
(EdmEntityType) ((UriResourceFunction) uriInfo.getUriResourceParts()
|
||||||
|
.get(uriInfo.getUriResourceParts().size() - 1)).getType() :
|
||||||
|
edmEntitySet.getEntityType();
|
||||||
|
|
||||||
final Entity entity = readEntity(uriInfo);
|
final Entity entity = readEntity(uriInfo);
|
||||||
|
|
||||||
final ODataFormat format = ODataFormat.fromContentType(requestedContentType);
|
final ODataFormat format = ODataFormat.fromContentType(requestedContentType);
|
||||||
|
@ -152,7 +164,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
||||||
response.setContent(serializer.entity(edmEntitySet.getEntityType(), entity,
|
response.setContent(serializer.entity(edmEntitySet.getEntityType(), entity,
|
||||||
EntitySerializerOptions.with()
|
EntitySerializerOptions.with()
|
||||||
.contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
|
.contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
|
||||||
getContextUrl(edmEntitySet, true, expand, select))
|
getContextUrl(edmEntitySet, edmEntityType, true, expand, select))
|
||||||
.expand(expand).select(select)
|
.expand(expand).select(select)
|
||||||
.build()));
|
.build()));
|
||||||
response.setStatusCode(HttpStatusCode.OK.getStatusCode());
|
response.setStatusCode(HttpStatusCode.OK.getStatusCode());
|
||||||
|
@ -205,7 +217,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
||||||
response.setContent(serializer.entity(edmEntityType, entity,
|
response.setContent(serializer.entity(edmEntityType, entity,
|
||||||
EntitySerializerOptions.with()
|
EntitySerializerOptions.with()
|
||||||
.contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
|
.contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
|
||||||
getContextUrl(edmEntitySet, true, null, null))
|
getContextUrl(edmEntitySet, edmEntityType, true, null, null))
|
||||||
.build()));
|
.build()));
|
||||||
response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());
|
response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());
|
||||||
response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
|
response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
|
||||||
|
@ -269,12 +281,15 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContextURL getContextUrl(final EdmEntitySet entitySet, final boolean isSingleEntity,
|
private ContextURL getContextUrl(final EdmEntitySet entitySet, final EdmEntityType entityType,
|
||||||
final ExpandOption expand, final SelectOption select) throws SerializerException {
|
final boolean isSingleEntity, final ExpandOption expand, final SelectOption select) throws SerializerException {
|
||||||
return ContextURL.with().entitySet(entitySet)
|
Builder builder = ContextURL.with();
|
||||||
.selectList(odata.createUriHelper()
|
builder = entitySet == null ?
|
||||||
.buildContextURLSelectList(entitySet.getEntityType(), expand, select))
|
isSingleEntity ? builder.type(entityType) : builder.asCollection().type(entityType) :
|
||||||
.suffix(isSingleEntity ? Suffix.ENTITY : null)
|
builder.entitySet(entitySet);
|
||||||
.build();
|
builder = builder.selectList(odata.createUriHelper()
|
||||||
|
.buildContextURLSelectList(entityType, expand, select))
|
||||||
|
.suffix(isSingleEntity ? Suffix.ENTITY : null);
|
||||||
|
return builder.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ import org.apache.olingo.commons.api.data.EntitySet;
|
||||||
import org.apache.olingo.commons.api.data.Link;
|
import org.apache.olingo.commons.api.data.Link;
|
||||||
import org.apache.olingo.commons.api.edm.EdmBindingTarget;
|
import org.apache.olingo.commons.api.edm.EdmBindingTarget;
|
||||||
import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
||||||
|
import org.apache.olingo.commons.api.edm.EdmEntityType;
|
||||||
|
import org.apache.olingo.commons.api.edm.EdmFunction;
|
||||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||||
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
import org.apache.olingo.commons.api.http.HttpStatusCode;
|
||||||
import org.apache.olingo.server.api.OData;
|
import org.apache.olingo.server.api.OData;
|
||||||
|
@ -36,6 +38,7 @@ import org.apache.olingo.server.api.uri.UriInfoResource;
|
||||||
import org.apache.olingo.server.api.uri.UriParameter;
|
import org.apache.olingo.server.api.uri.UriParameter;
|
||||||
import org.apache.olingo.server.api.uri.UriResource;
|
import org.apache.olingo.server.api.uri.UriResource;
|
||||||
import org.apache.olingo.server.api.uri.UriResourceEntitySet;
|
import org.apache.olingo.server.api.uri.UriResourceEntitySet;
|
||||||
|
import org.apache.olingo.server.api.uri.UriResourceFunction;
|
||||||
import org.apache.olingo.server.api.uri.UriResourceNavigation;
|
import org.apache.olingo.server.api.uri.UriResourceNavigation;
|
||||||
import org.apache.olingo.server.tecsvc.data.DataProvider;
|
import org.apache.olingo.server.tecsvc.data.DataProvider;
|
||||||
|
|
||||||
|
@ -61,34 +64,31 @@ public abstract class TechnicalProcessor implements Processor {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EdmEntitySet getEdmEntitySet(final UriInfoResource uriInfo) throws ODataApplicationException {
|
protected EdmEntitySet getEdmEntitySet(final UriInfoResource uriInfo) throws ODataApplicationException {
|
||||||
|
EdmEntitySet entitySet = null;
|
||||||
final List<UriResource> resourcePaths = uriInfo.getUriResourceParts();
|
final List<UriResource> resourcePaths = uriInfo.getUriResourceParts();
|
||||||
// first must be entity set
|
|
||||||
if (!(resourcePaths.get(0) instanceof UriResourceEntitySet)) {
|
// First must be entity set or function import.
|
||||||
|
blockTypeFilters(resourcePaths.get(0));
|
||||||
|
if (resourcePaths.get(0) instanceof UriResourceEntitySet) {
|
||||||
|
entitySet = ((UriResourceEntitySet) resourcePaths.get(0)).getEntitySet();
|
||||||
|
} else if (resourcePaths.get(0) instanceof UriResourceFunction) {
|
||||||
|
entitySet = ((UriResourceFunction) resourcePaths.get(0)).getFunctionImport().getReturnedEntitySet();
|
||||||
|
} else {
|
||||||
throw new ODataApplicationException("Invalid resource type.",
|
throw new ODataApplicationException("Invalid resource type.",
|
||||||
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
final UriResourceEntitySet uriResource = (UriResourceEntitySet) resourcePaths.get(0);
|
|
||||||
if (uriResource.getTypeFilterOnCollection() != null || uriResource.getTypeFilterOnEntry() != null) {
|
|
||||||
throw new ODataApplicationException("Type filters are not supported.",
|
|
||||||
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
|
||||||
}
|
|
||||||
EdmEntitySet entitySet = uriResource.getEntitySet();
|
|
||||||
|
|
||||||
int navigationCount = 0;
|
int navigationCount = 0;
|
||||||
while (++navigationCount < resourcePaths.size()
|
while (entitySet != null
|
||||||
|
&& ++navigationCount < resourcePaths.size()
|
||||||
&& resourcePaths.get(navigationCount) instanceof UriResourceNavigation) {
|
&& resourcePaths.get(navigationCount) instanceof UriResourceNavigation) {
|
||||||
final UriResourceNavigation uriNavigationResource = (UriResourceNavigation) resourcePaths.get(navigationCount);
|
final UriResourceNavigation uriResourceNavigation = (UriResourceNavigation) resourcePaths.get(navigationCount);
|
||||||
if (uriNavigationResource.getTypeFilterOnCollection() != null
|
blockTypeFilters(uriResourceNavigation);
|
||||||
|| uriNavigationResource.getTypeFilterOnEntry() != null) {
|
if (uriResourceNavigation.getProperty().containsTarget()) {
|
||||||
throw new ODataApplicationException("Type filters are not supported.",
|
|
||||||
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
|
||||||
}
|
|
||||||
if (uriNavigationResource.getProperty().containsTarget()) {
|
|
||||||
throw new ODataApplicationException("Containment navigation is not supported.",
|
throw new ODataApplicationException("Containment navigation is not supported.",
|
||||||
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
}
|
}
|
||||||
final EdmBindingTarget target = entitySet.getRelatedBindingTarget(uriNavigationResource.getProperty().getName());
|
final EdmBindingTarget target = entitySet.getRelatedBindingTarget(uriResourceNavigation.getProperty().getName());
|
||||||
if (target instanceof EdmEntitySet) {
|
if (target instanceof EdmEntitySet) {
|
||||||
entitySet = (EdmEntitySet) target;
|
entitySet = (EdmEntitySet) target;
|
||||||
} else {
|
} else {
|
||||||
|
@ -107,8 +107,31 @@ public abstract class TechnicalProcessor implements Processor {
|
||||||
*/
|
*/
|
||||||
protected Entity readEntity(final UriInfoResource uriInfo) throws ODataApplicationException {
|
protected Entity readEntity(final UriInfoResource uriInfo) throws ODataApplicationException {
|
||||||
final List<UriResource> resourcePaths = uriInfo.getUriResourceParts();
|
final List<UriResource> resourcePaths = uriInfo.getUriResourceParts();
|
||||||
final UriResourceEntitySet uriResource = (UriResourceEntitySet) resourcePaths.get(0);
|
|
||||||
Entity entity = dataProvider.read(uriResource.getEntitySet(), uriResource.getKeyPredicates());
|
Entity entity = null;
|
||||||
|
if (resourcePaths.get(0) instanceof UriResourceEntitySet) {
|
||||||
|
final UriResourceEntitySet uriResource = (UriResourceEntitySet) resourcePaths.get(0);
|
||||||
|
entity = dataProvider.read(uriResource.getEntitySet(), uriResource.getKeyPredicates());
|
||||||
|
} else if (resourcePaths.get(0) instanceof UriResourceFunction) {
|
||||||
|
final UriResourceFunction uriResource = (UriResourceFunction) resourcePaths.get(0);
|
||||||
|
final EdmFunction function = uriResource.getFunction();
|
||||||
|
if (function.getReturnType().getType() instanceof EdmEntityType) {
|
||||||
|
final List<UriParameter> key = uriResource.getKeyPredicates();
|
||||||
|
if (key.isEmpty()) {
|
||||||
|
if (uriResource.isCollection()) { // handled in readEntityCollection()
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
entity = dataProvider.readFunctionEntity(function, uriResource.getParameters());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entity = dataProvider.read((EdmEntityType) function.getReturnType().getType(),
|
||||||
|
dataProvider.readFunctionEntitySet(function, uriResource.getParameters()),
|
||||||
|
key);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new ODataApplicationException("Nothing found.", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ROOT);
|
throw new ODataApplicationException("Nothing found.", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +142,7 @@ public abstract class TechnicalProcessor implements Processor {
|
||||||
final UriResourceNavigation uriNavigationResource = (UriResourceNavigation) resourcePaths.get(navigationCount);
|
final UriResourceNavigation uriNavigationResource = (UriResourceNavigation) resourcePaths.get(navigationCount);
|
||||||
final EdmNavigationProperty navigationProperty = uriNavigationResource.getProperty();
|
final EdmNavigationProperty navigationProperty = uriNavigationResource.getProperty();
|
||||||
final List<UriParameter> key = uriNavigationResource.getKeyPredicates();
|
final List<UriParameter> key = uriNavigationResource.getKeyPredicates();
|
||||||
if (navigationProperty.isCollection() && key.isEmpty()) {
|
if (navigationProperty.isCollection() && key.isEmpty()) { // handled in readEntityCollection()
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
final Link link = entity.getNavigationLink(navigationProperty.getName());
|
final Link link = entity.getNavigationLink(navigationProperty.getName());
|
||||||
|
@ -142,7 +165,12 @@ public abstract class TechnicalProcessor implements Processor {
|
||||||
final Link link = entity.getNavigationLink(getLastNavigation(uriInfo).getProperty().getName());
|
final Link link = entity.getNavigationLink(getLastNavigation(uriInfo).getProperty().getName());
|
||||||
return link == null ? null : link.getInlineEntitySet();
|
return link == null ? null : link.getInlineEntitySet();
|
||||||
} else {
|
} else {
|
||||||
return dataProvider.readAll(((UriResourceEntitySet) resourcePaths.get(0)).getEntitySet());
|
if (resourcePaths.get(0) instanceof UriResourceFunction) {
|
||||||
|
final UriResourceFunction uriResource = (UriResourceFunction) resourcePaths.get(0);
|
||||||
|
return dataProvider.readFunctionEntitySet(uriResource.getFunction(), uriResource.getParameters());
|
||||||
|
} else {
|
||||||
|
return dataProvider.readAll(((UriResourceEntitySet) resourcePaths.get(0)).getEntitySet());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +185,21 @@ public abstract class TechnicalProcessor implements Processor {
|
||||||
return (UriResourceNavigation) resourcePaths.get(--navigationCount);
|
return (UriResourceNavigation) resourcePaths.get(--navigationCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void blockTypeFilters(final UriResource uriResource) throws ODataApplicationException {
|
||||||
|
if (uriResource instanceof UriResourceEntitySet
|
||||||
|
&& (((UriResourceEntitySet) uriResource).getTypeFilterOnCollection() != null
|
||||||
|
|| ((UriResourceEntitySet) uriResource).getTypeFilterOnEntry() != null)
|
||||||
|
|| uriResource instanceof UriResourceFunction
|
||||||
|
&& (((UriResourceFunction) uriResource).getTypeFilterOnCollection() != null
|
||||||
|
|| ((UriResourceFunction) uriResource).getTypeFilterOnEntry() != null)
|
||||||
|
|| uriResource instanceof UriResourceNavigation
|
||||||
|
&& (((UriResourceNavigation) uriResource).getTypeFilterOnCollection() != null
|
||||||
|
|| ((UriResourceNavigation) uriResource).getTypeFilterOnEntry() != null)) {
|
||||||
|
throw new ODataApplicationException("Type filters are not supported.",
|
||||||
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void validateOptions(final UriInfoResource uriInfo) throws ODataApplicationException {
|
protected void validateOptions(final UriInfoResource uriInfo) throws ODataApplicationException {
|
||||||
if (uriInfo.getIdOption() != null
|
if (uriInfo.getIdOption() != null
|
||||||
|| uriInfo.getSearchOption() != null) {
|
|| uriInfo.getSearchOption() != null) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class ServerSidePagingHandler {
|
||||||
public static void applyServerSidePaging(final SkipTokenOption skipTokenOption, final EntitySet entitySet,
|
public static void applyServerSidePaging(final SkipTokenOption skipTokenOption, final EntitySet entitySet,
|
||||||
final EdmEntitySet edmEntitySet, final String rawRequestUri) throws ODataApplicationException {
|
final EdmEntitySet edmEntitySet, final String rawRequestUri) throws ODataApplicationException {
|
||||||
|
|
||||||
if (shouldApplyServerSidePaging(edmEntitySet)) {
|
if (edmEntitySet != null && shouldApplyServerSidePaging(edmEntitySet)) {
|
||||||
final int maxPageSize = getMaxPageSize();
|
final int maxPageSize = getMaxPageSize();
|
||||||
final int page = getPage(skipTokenOption);
|
final int page = getPage(skipTokenOption);
|
||||||
final int itemsToSkip = maxPageSize * page;
|
final int itemsToSkip = maxPageSize * page;
|
||||||
|
|
|
@ -123,19 +123,21 @@ public class ContainerProvider {
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisibleRTInt16"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisibleRTInt16"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisible2RTInt16"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisible2RTInt16"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETKeyNav"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETKeyNav"));
|
||||||
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESTwoKeyNav"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETTwoKeyNavParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETTwoKeyNavParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTStringTwoParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTStringTwoParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollStringTwoParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollStringTwoParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTAllPrimTwoParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTAllPrimTwoParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESMixPrimCollCompTwoParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESMixPrimCollCompTwoParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTESMixPrimCollCompTwoParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollETMixPrimCollCompTwoParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrim"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrim"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETMedia"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESMedia"));
|
||||||
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollESMedia"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrimParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrimParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrim"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrim"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollString"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollString"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTString"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTString"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESTwoKeyNavParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollESTwoKeyNavParam"));
|
||||||
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrimParam"));
|
functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrimParam"));
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
|
@ -444,106 +446,120 @@ public class ContainerProvider {
|
||||||
if (entityContainer.equals(nameContainer)) {
|
if (entityContainer.equals(nameContainer)) {
|
||||||
if (name.equals("FINRTInt16")) {
|
if (name.equals("FINRTInt16")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FINRTInt16")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFNRTInt16)
|
.setFunction(FunctionProvider.nameUFNRTInt16)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FINInvisibleRTInt16")) {
|
} else if (name.equals("FINInvisibleRTInt16")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FINInvisibleRTInt16")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFNRTInt16);
|
.setFunction(FunctionProvider.nameUFNRTInt16);
|
||||||
|
|
||||||
} else if (name.equals("FINInvisible2RTInt16")) {
|
} else if (name.equals("FINInvisible2RTInt16")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FINInvisible2RTInt16")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFNRTInt16);
|
.setFunction(FunctionProvider.nameUFNRTInt16);
|
||||||
|
|
||||||
} else if (name.equals("FICRTETKeyNav")) {
|
} else if (name.equals("FICRTETKeyNav")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTETKeyNav")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTETKeyNav);
|
.setFunction(FunctionProvider.nameUFCRTETKeyNav);
|
||||||
|
|
||||||
|
} else if (name.equals("FICRTESTwoKeyNav")) {
|
||||||
|
return new FunctionImport()
|
||||||
|
.setName(name)
|
||||||
|
.setFunction(FunctionProvider.nameUFCRTETTwoKeyNav)
|
||||||
|
.setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESTwoKeyNav"))
|
||||||
|
.setIncludeInServiceDocument(true);
|
||||||
} else if (name.equals("FICRTETTwoKeyNavParam")) {
|
} else if (name.equals("FICRTETTwoKeyNavParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTETTwoKeyNavParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTETTwoKeyNavParam)
|
.setFunction(FunctionProvider.nameUFCRTETTwoKeyNavParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTStringTwoParam")) {
|
} else if (name.equals("FICRTStringTwoParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTStringTwoParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTStringTwoParam)
|
.setFunction(FunctionProvider.nameUFCRTStringTwoParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCollStringTwoParam")) {
|
} else if (name.equals("FICRTCollStringTwoParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCollStringTwoParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCollStringTwoParam)
|
.setFunction(FunctionProvider.nameUFCRTCollStringTwoParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCTAllPrimTwoParam")) {
|
} else if (name.equals("FICRTCTAllPrimTwoParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCTAllPrimTwoParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCTAllPrimTwoParam)
|
.setFunction(FunctionProvider.nameUFCRTCTAllPrimTwoParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTESMixPrimCollCompTwoParam")) {
|
} else if (name.equals("FICRTESMixPrimCollCompTwoParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTESMixPrimCollCompTwoParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam)
|
.setFunction(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FINRTESMixPrimCollCompTwoParam")) {
|
} else if (name.equals("FICRTCollETMixPrimCollCompTwoParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FINRTESMixPrimCollCompTwoParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam)
|
.setFunction(FunctionProvider.nameUFCRTCollETMixPrimCollCompTwoParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCollCTTwoPrim")) {
|
} else if (name.equals("FICRTCollCTTwoPrim")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCollCTTwoPrim")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCollCTTwoPrim)
|
.setFunction(FunctionProvider.nameUFCRTCollCTTwoPrim)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTETMedia")) {
|
} else if (name.equals("FICRTESMedia")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTETMedia")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTETMedia)
|
.setFunction(FunctionProvider.nameUFCRTETMedia)
|
||||||
|
.setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESMedia"))
|
||||||
|
.setIncludeInServiceDocument(true);
|
||||||
|
} else if (name.equals("FICRTCollESMedia")) {
|
||||||
|
return new FunctionImport()
|
||||||
|
.setName(name)
|
||||||
|
.setFunction(FunctionProvider.nameUFCRTCollETMedia)
|
||||||
|
.setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESMedia"))
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCTTwoPrimParam")) {
|
} else if (name.equals("FICRTCTTwoPrimParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCTTwoPrimParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCTTwoPrimParam)
|
.setFunction(FunctionProvider.nameUFCRTCTTwoPrimParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCTTwoPrim")) {
|
} else if (name.equals("FICRTCTTwoPrim")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCTTwoPrim")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCTTwoPrim)
|
.setFunction(FunctionProvider.nameUFCRTCTTwoPrim)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCollString")) {
|
} else if (name.equals("FICRTCollString")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCollString")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCollString)
|
.setFunction(FunctionProvider.nameUFCRTCollString)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTString")) {
|
} else if (name.equals("FICRTString")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTString")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTString)
|
.setFunction(FunctionProvider.nameUFCRTString)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTESTwoKeyNavParam")) {
|
} else if (name.equals("FICRTCollESTwoKeyNavParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTESTwoKeyNavParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam)
|
.setFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam)
|
||||||
|
.setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESTwoKeyNav"))
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
} else if (name.equals("FICRTCollCTTwoPrimParam")) {
|
} else if (name.equals("FICRTCollCTTwoPrimParam")) {
|
||||||
return new FunctionImport()
|
return new FunctionImport()
|
||||||
.setName("FICRTCollCTTwoPrimParam")
|
.setName(name)
|
||||||
.setFunction(FunctionProvider.nameUFCRTCollCTTwoPrimParam)
|
.setFunction(FunctionProvider.nameUFCRTCollCTTwoPrimParam)
|
||||||
.setIncludeInServiceDocument(true);
|
.setIncludeInServiceDocument(true);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.apache.olingo.server.api.edm.provider.ReturnType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class FunctionProvider {
|
public class FunctionProvider {
|
||||||
|
@ -112,6 +113,12 @@ public class FunctionProvider {
|
||||||
public static final FullQualifiedName nameBFESTwoKeyNavRTESTwoKeyNav =
|
public static final FullQualifiedName nameBFESTwoKeyNavRTESTwoKeyNav =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "BFESTwoKeyNavRTESTwoKeyNav");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "BFESTwoKeyNavRTESTwoKeyNav");
|
||||||
|
|
||||||
|
public static final FullQualifiedName nameBFCESTwoKeyNavRTCTNavFiveProp = new FullQualifiedName(
|
||||||
|
SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCTNavFiveProp");
|
||||||
|
|
||||||
|
public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName(
|
||||||
|
SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollCTNavFiveProp");
|
||||||
|
|
||||||
// Unbound Functions
|
// Unbound Functions
|
||||||
public static final FullQualifiedName nameUFCRTCollCTTwoPrim =
|
public static final FullQualifiedName nameUFCRTCollCTTwoPrim =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollCTTwoPrim");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollCTTwoPrim");
|
||||||
|
@ -129,15 +136,19 @@ public class FunctionProvider {
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCTTwoPrimParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCTTwoPrimParam");
|
||||||
public static final FullQualifiedName nameUFCRTESMixPrimCollCompTwoParam =
|
public static final FullQualifiedName nameUFCRTESMixPrimCollCompTwoParam =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTESMixPrimCollCompTwoParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTESMixPrimCollCompTwoParam");
|
||||||
public static final FullQualifiedName nameUFCRTESTwoKeyNavParam =
|
public static final FullQualifiedName nameUFCRTCollETTwoKeyNavParam =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTESTwoKeyNavParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETTwoKeyNavParam");
|
||||||
public static final FullQualifiedName nameUFCRTETAllPrimTwoParam =
|
public static final FullQualifiedName nameUFCRTETAllPrimTwoParam =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTETAllPrimTwoParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTETAllPrimTwoParam");
|
||||||
public static final FullQualifiedName nameUFCRTETKeyNav = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
public static final FullQualifiedName nameUFCRTETKeyNav = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
||||||
"UFCRTETKeyNav");
|
"UFCRTETKeyNav");
|
||||||
public static final FullQualifiedName nameUFCRTETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
public static final FullQualifiedName nameUFCRTETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
||||||
"UFCRTETMedia");
|
"UFCRTETMedia");
|
||||||
|
public static final FullQualifiedName nameUFCRTCollETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
||||||
|
"UFCRTCollETMedia");
|
||||||
|
|
||||||
|
public static final FullQualifiedName nameUFCRTETTwoKeyNav =
|
||||||
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTETTwoKeyNav");
|
||||||
public static final FullQualifiedName nameUFCRTETTwoKeyNavParam =
|
public static final FullQualifiedName nameUFCRTETTwoKeyNavParam =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTETTwoKeyNavParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTETTwoKeyNavParam");
|
||||||
|
|
||||||
|
@ -150,30 +161,23 @@ public class FunctionProvider {
|
||||||
public static final FullQualifiedName nameUFCRTStringTwoParam =
|
public static final FullQualifiedName nameUFCRTStringTwoParam =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTStringTwoParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTStringTwoParam");
|
||||||
|
|
||||||
public static final FullQualifiedName nameUFNRTESMixPrimCollCompTwoParam =
|
public static final FullQualifiedName nameUFCRTCollETMixPrimCollCompTwoParam =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTESMixPrimCollCompTwoParam");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETMixPrimCollCompTwoParam");
|
||||||
|
|
||||||
public static final FullQualifiedName nameUFNRTInt16 =
|
public static final FullQualifiedName nameUFNRTInt16 =
|
||||||
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTInt16");
|
new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTInt16");
|
||||||
|
|
||||||
public static final FullQualifiedName nameUFNRTCollCTNavFiveProp = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
public static final FullQualifiedName nameUFNRTCollCTNavFiveProp = new FullQualifiedName(SchemaProvider.NAMESPACE,
|
||||||
"UFNRTCollCTNavFiveProp");
|
"UFNRTCollCTNavFiveProp");
|
||||||
|
|
||||||
public static final FullQualifiedName nameBFCESTwoKeyNavRTCTNavFiveProp = new FullQualifiedName(
|
|
||||||
SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCTNavFiveProp");
|
|
||||||
|
|
||||||
public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName(
|
|
||||||
SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollCTNavFiveProp");
|
|
||||||
|
|
||||||
public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
|
public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
|
||||||
|
|
||||||
if (functionName.equals(nameUFNRTInt16)) {
|
if (functionName.equals(nameUFNRTInt16)) {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new Function()
|
new Function()
|
||||||
.setName("UFNRTInt16")
|
.setName(functionName.getName())
|
||||||
.setParameters(new ArrayList<Parameter>())
|
.setParameters(Collections.<Parameter> emptyList())
|
||||||
.setReturnType(
|
.setReturnType(new ReturnType().setType(PropertyProvider.nameInt16)));
|
||||||
new ReturnType().setType(PropertyProvider.nameInt16))
|
|
||||||
);
|
|
||||||
|
|
||||||
} else if (functionName.equals(nameUFCRTETKeyNav)) {
|
} else if (functionName.equals(nameUFCRTETKeyNav)) {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
|
@ -185,6 +189,14 @@ public class FunctionProvider {
|
||||||
new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
|
new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
} else if (functionName.equals(nameUFCRTETTwoKeyNav)) {
|
||||||
|
return Collections.singletonList(
|
||||||
|
new Function()
|
||||||
|
.setName(functionName.getName())
|
||||||
|
.setParameters(Collections.<Parameter> emptyList())
|
||||||
|
.setComposable(true)
|
||||||
|
.setReturnType(
|
||||||
|
new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)));
|
||||||
} else if (functionName.equals(nameUFCRTETTwoKeyNavParam)) {
|
} else if (functionName.equals(nameUFCRTETTwoKeyNavParam)) {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new Function()
|
new Function()
|
||||||
|
@ -238,11 +250,11 @@ public class FunctionProvider {
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if (functionName.equals(nameUFCRTESTwoKeyNavParam)) {
|
} else if (functionName.equals(nameUFCRTCollETTwoKeyNavParam)) {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new Function()
|
new Function()
|
||||||
.setName("UFCRTESTwoKeyNavParam")
|
.setName("UFCRTESTwoKeyNavParam")
|
||||||
.setParameters(Arrays.asList(
|
.setParameters(Collections.singletonList(
|
||||||
new Parameter()
|
new Parameter()
|
||||||
.setName("ParameterInt16")
|
.setName("ParameterInt16")
|
||||||
.setType(PropertyProvider.nameInt16)
|
.setType(PropertyProvider.nameInt16)
|
||||||
|
@ -351,8 +363,16 @@ public class FunctionProvider {
|
||||||
.setReturnType(
|
.setReturnType(
|
||||||
new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false))
|
new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false))
|
||||||
);
|
);
|
||||||
|
} else if (functionName.equals(nameUFCRTCollETMedia)) {
|
||||||
|
return Arrays.asList(
|
||||||
|
new Function()
|
||||||
|
.setName(functionName.getName())
|
||||||
|
.setParameters(Collections.<Parameter> emptyList())
|
||||||
|
.setComposable(true)
|
||||||
|
.setReturnType(
|
||||||
|
new ReturnType().setType(EntityTypeProvider.nameETMedia).setCollection(true).setNullable(false)));
|
||||||
|
|
||||||
} else if (functionName.equals(nameUFNRTESMixPrimCollCompTwoParam)) {
|
} else if (functionName.equals(nameUFCRTCollETMixPrimCollCompTwoParam)) {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new Function()
|
new Function()
|
||||||
.setName("UFNRTESMixPrimCollCompTwoParam")
|
.setName("UFNRTESMixPrimCollCompTwoParam")
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class SchemaProvider {
|
||||||
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));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESTwoKeyNavParam));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollETTwoKeyNavParam));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTString));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTString));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollStringTwoParam));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollStringTwoParam));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollString));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollString));
|
||||||
|
@ -140,7 +140,7 @@ public class SchemaProvider {
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrim));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrim));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrim));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrim));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETMedia));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETMedia));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollETMixPrimCollCompTwoParam));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETAllPrimTwoParam));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETAllPrimTwoParam));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam));
|
||||||
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTCollCTNavFiveProp));
|
functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTCollCTNavFiveProp));
|
||||||
|
|
|
@ -299,7 +299,7 @@ public class ODataHandlerTest {
|
||||||
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
|
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
|
||||||
|
|
||||||
EntityCollectionProcessor entityCollectionProcessor = mock(EntityCollectionProcessor.class);
|
EntityCollectionProcessor entityCollectionProcessor = mock(EntityCollectionProcessor.class);
|
||||||
dispatch(HttpMethod.GET, "FICRTESTwoKeyNavParam(ParameterInt16=123)", entityCollectionProcessor);
|
dispatch(HttpMethod.GET, "FICRTCollESTwoKeyNavParam(ParameterInt16=123)", entityCollectionProcessor);
|
||||||
verify(entityCollectionProcessor).readEntityCollection(
|
verify(entityCollectionProcessor).readEntityCollection(
|
||||||
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
|
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
|
||||||
|
|
||||||
|
|
|
@ -219,11 +219,11 @@ public class UriResourceImplTest {
|
||||||
|
|
||||||
// function collection
|
// function collection
|
||||||
impl = new UriResourceFunctionImpl();
|
impl = new UriResourceFunctionImpl();
|
||||||
functionImport = edm.getEntityContainer(null).getFunctionImport("FICRTESTwoKeyNavParam");
|
functionImport = edm.getEntityContainer(null).getFunctionImport("FICRTCollESTwoKeyNavParam");
|
||||||
assertNotNull(function);
|
assertNotNull(function);
|
||||||
UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
|
UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
|
||||||
impl.setFunctionImport(functionImport, Arrays.asList(parameter));
|
impl.setFunctionImport(functionImport, Arrays.asList(parameter));
|
||||||
assertEquals("FICRTESTwoKeyNavParam", impl.toString());
|
assertEquals("FICRTCollESTwoKeyNavParam", impl.toString());
|
||||||
|
|
||||||
impl.setFunction(functionImport.getUnboundFunction(Arrays.asList("ParameterInt16")));
|
impl.setFunction(functionImport.getUnboundFunction(Arrays.asList("ParameterInt16")));
|
||||||
assertEquals(true, impl.isCollection());
|
assertEquals(true, impl.isCollection());
|
||||||
|
|
|
@ -1699,13 +1699,13 @@ public class TestFullResourcePath {
|
||||||
.n()
|
.n()
|
||||||
.isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
|
.isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
|
||||||
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
|
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
|
||||||
+ "/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
|
+ "/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
||||||
|
@ -1733,10 +1733,10 @@ public class TestFullResourcePath {
|
||||||
.isKeyPredicate(0, "PropertyInt16", "2")
|
.isKeyPredicate(0, "PropertyInt16", "2")
|
||||||
.isKeyPredicate(1, "PropertyString", "'3'");
|
.isKeyPredicate(1, "PropertyString", "'3'");
|
||||||
|
|
||||||
testUri.run("FICRTETMedia()/$value")
|
testUri.run("FICRTESMedia()/$value")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTETMedia")
|
.isFunctionImport("FICRTESMedia")
|
||||||
.isFunction("UFCRTETMedia")
|
.isFunction("UFCRTETMedia")
|
||||||
.n()
|
.n()
|
||||||
.isValue();
|
.isValue();
|
||||||
|
@ -1748,11 +1748,11 @@ public class TestFullResourcePath {
|
||||||
.isFunction("UFCRTETKeyNav")
|
.isFunction("UFCRTETKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isRef();
|
.isRef();
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/$ref")
|
testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/$ref")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTETTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTETTwoKeyNavParam")
|
||||||
.n()
|
.n()
|
||||||
.isRef();
|
.isRef();
|
||||||
|
|
||||||
|
@ -1777,12 +1777,12 @@ public class TestFullResourcePath {
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
|
.isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
|
||||||
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
|
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
||||||
|
@ -1802,11 +1802,11 @@ public class TestFullResourcePath {
|
||||||
.isParameter(1, "ParameterString", "'2'")
|
.isParameter(1, "ParameterString", "'2'")
|
||||||
.isType(EntityTypeProvider.nameETMixPrimCollComp);
|
.isType(EntityTypeProvider.nameETMixPrimCollComp);
|
||||||
|
|
||||||
testUri.run("FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
|
testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FINRTESMixPrimCollCompTwoParam")
|
.isFunctionImport("FICRTESMixPrimCollCompTwoParam")
|
||||||
.isFunction("UFNRTESMixPrimCollCompTwoParam")
|
.isFunction("UFCRTESMixPrimCollCompTwoParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isParameter(1, "ParameterString", "'2'")
|
.isParameter(1, "ParameterString", "'2'")
|
||||||
.isType(EntityTypeProvider.nameETMixPrimCollComp);
|
.isType(EntityTypeProvider.nameETMixPrimCollComp);
|
||||||
|
@ -1836,53 +1836,53 @@ public class TestFullResourcePath {
|
||||||
@Test
|
@Test
|
||||||
public void runFunctionImpEsAlias() throws Exception {
|
public void runFunctionImpEsAlias() throws Exception {
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@parameterAlias)", "@parameterAlias=1");
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@parameterAlias)", "@parameterAlias=1");
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@parameterAlias)/$count", "@parameterAlias=1");
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@parameterAlias)/$count", "@parameterAlias=1");
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)", "@validAlias=1");
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@invalidAlias)", "@validAlias=1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void runFunctionImpEsCast() throws Exception {
|
public void runFunctionImpEsCast() throws Exception {
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav);
|
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav);
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav/$count")
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav/$count")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
||||||
.n()
|
.n()
|
||||||
.isCount();
|
.isCount();
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
|
||||||
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
|
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
||||||
.isKeyPredicate(0, "PropertyInt16", "2")
|
.isKeyPredicate(0, "PropertyInt16", "2")
|
||||||
.isKeyPredicate(1, "PropertyString", "'3'");
|
.isKeyPredicate(1, "PropertyString", "'3'");
|
||||||
|
|
||||||
testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
|
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
|
||||||
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
|
+ "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
|
||||||
+ "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
|
+ "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
.isType(EntityTypeProvider.nameETTwoKeyNav)
|
||||||
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
.isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
|
||||||
|
|
|
@ -655,9 +655,9 @@ public class TestUriParserImpl {
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav, false);
|
.isType(EntityTypeProvider.nameETTwoKeyNav, false);
|
||||||
|
|
||||||
// returning collection of entity (aka entitySet)
|
// returning collection of entity (aka entitySet)
|
||||||
testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)")
|
testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)")
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav, true);
|
.isType(EntityTypeProvider.nameETTwoKeyNav, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -686,20 +686,20 @@ public class TestUriParserImpl {
|
||||||
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
||||||
|
|
||||||
// test chains; returning collection of entity (aka entitySet)
|
// test chains; returning collection of entity (aka entitySet)
|
||||||
testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')")
|
testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')")
|
||||||
.at(0)
|
.at(0)
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav, false)
|
.isType(EntityTypeProvider.nameETTwoKeyNav, false)
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isKeyPredicate(0, "PropertyInt16", "1")
|
.isKeyPredicate(0, "PropertyInt16", "1")
|
||||||
.isKeyPredicate(1, "PropertyString", "'ABC'");
|
.isKeyPredicate(1, "PropertyString", "'ABC'");
|
||||||
|
|
||||||
// test chains; returning collection of entity (aka entitySet)
|
// test chains; returning collection of entity (aka entitySet)
|
||||||
testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')/PropertyInt16")
|
testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')/PropertyInt16")
|
||||||
.at(0)
|
.at(0)
|
||||||
.isFunctionImport("FICRTESTwoKeyNavParam")
|
.isFunctionImport("FICRTCollESTwoKeyNavParam")
|
||||||
.isFunction("UFCRTESTwoKeyNavParam")
|
.isFunction("UFCRTCollETTwoKeyNavParam")
|
||||||
.isType(EntityTypeProvider.nameETTwoKeyNav, false)
|
.isType(EntityTypeProvider.nameETTwoKeyNav, false)
|
||||||
.isParameter(0, "ParameterInt16", "1")
|
.isParameter(0, "ParameterInt16", "1")
|
||||||
.isKeyPredicate(0, "PropertyInt16", "1")
|
.isKeyPredicate(0, "PropertyInt16", "1")
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class ExpressionTest {
|
||||||
|
|
||||||
// UriResourceImplKeyPred typeFilter on entry
|
// UriResourceImplKeyPred typeFilter on entry
|
||||||
EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
|
EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
|
||||||
function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
|
function = edm.getUnboundFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam, Arrays.asList("ParameterInt16"));
|
||||||
expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
|
expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
|
||||||
new UriResourceFunctionImpl().setFunction(function).setEntryTypeFilter(entityBaseType))
|
new UriResourceFunctionImpl().setFunction(function).setEntryTypeFilter(entityBaseType))
|
||||||
.asUriInfoResource());
|
.asUriInfoResource());
|
||||||
|
@ -179,7 +179,7 @@ public class ExpressionTest {
|
||||||
|
|
||||||
// UriResourceImplKeyPred typeFilter on entry
|
// UriResourceImplKeyPred typeFilter on entry
|
||||||
entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
|
entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
|
||||||
function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
|
function = edm.getUnboundFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam, Arrays.asList("ParameterInt16"));
|
||||||
expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
|
expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
|
||||||
new UriResourceFunctionImpl().setFunction(function).setCollectionTypeFilter(entityBaseType))
|
new UriResourceFunctionImpl().setFunction(function).setCollectionTypeFilter(entityBaseType))
|
||||||
.asUriInfoResource());
|
.asUriInfoResource());
|
||||||
|
@ -187,7 +187,7 @@ public class ExpressionTest {
|
||||||
|
|
||||||
// no typed
|
// no typed
|
||||||
entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
|
entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
|
||||||
function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
|
function = edm.getUnboundFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam, Arrays.asList("ParameterInt16"));
|
||||||
expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.all));
|
expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.all));
|
||||||
assertEquals(null, expression.getType());
|
assertEquals(null, expression.getType());
|
||||||
|
|
||||||
|
|
|
@ -145,11 +145,11 @@ public class UriValidatorTest {
|
||||||
|
|
||||||
{ "FINRTInt16()" },
|
{ "FINRTInt16()" },
|
||||||
{ "FICRTETKeyNav()" },
|
{ "FICRTETKeyNav()" },
|
||||||
{ "FICRTESTwoKeyNavParam(ParameterInt16=1)" },
|
{ "FICRTETTwoKeyNavParam(ParameterInt16=1)" },
|
||||||
{ "FICRTCollString()" },
|
{ "FICRTCollString()" },
|
||||||
{ "FICRTCTTwoPrim()" },
|
{ "FICRTCTTwoPrim()" },
|
||||||
{ "FICRTCollCTTwoPrim()" },
|
{ "FICRTCollCTTwoPrim()" },
|
||||||
{ "FICRTETMedia()" },
|
{ "FICRTESMedia()" },
|
||||||
|
|
||||||
{ "ESTwoKeyNav/olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav" },
|
{ "ESTwoKeyNav/olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav" },
|
||||||
{ "ESAllPrim/olingo.odata.test1.BAESAllPrimRTETAllPrim" },
|
{ "ESAllPrim/olingo.odata.test1.BAESAllPrimRTETAllPrim" },
|
||||||
|
|
Loading…
Reference in New Issue