[OLINGO-573] Minor clean up after merge with master
This commit is contained in:
parent
3f79ced17a
commit
7119be1f26
|
@ -565,10 +565,6 @@ public class DataCreator {
|
||||||
return new PropertyImpl(null, name, ValueType.COLLECTION_PRIMITIVE, Arrays.asList(values));
|
return new PropertyImpl(null, name, ValueType.COLLECTION_PRIMITIVE, Arrays.asList(values));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static Property createComplex(final String name, String type, final Property... properties) {
|
|
||||||
return createComplex(name, properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static Property createComplex(final String name, final Property... properties) {
|
protected static Property createComplex(final String name, final Property... properties) {
|
||||||
ComplexValue complexValue = new ComplexValueImpl();
|
ComplexValue complexValue = new ComplexValueImpl();
|
||||||
for (final Property property : properties) {
|
for (final Property property : properties) {
|
||||||
|
@ -577,11 +573,6 @@ public class DataCreator {
|
||||||
return new PropertyImpl(null, name, ValueType.COMPLEX, complexValue);
|
return new PropertyImpl(null, name, ValueType.COMPLEX, complexValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static Property createComplexCollection(final String name, String type, final List<Property>...
|
|
||||||
propertiesList) {
|
|
||||||
return createComplexCollection(name, propertiesList);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static Property createComplexCollection(final String name, final List<Property>... propertiesList) {
|
protected static Property createComplexCollection(final String name, final List<Property>... propertiesList) {
|
||||||
List<ComplexValue> complexCollection = new ArrayList<ComplexValue>();
|
List<ComplexValue> complexCollection = new ArrayList<ComplexValue>();
|
||||||
for (final List<Property> properties : propertiesList) {
|
for (final List<Property> properties : propertiesList) {
|
||||||
|
|
|
@ -217,12 +217,10 @@ public class DataProvider {
|
||||||
} else {
|
} else {
|
||||||
if (edmProperty.isCollection()) {
|
if (edmProperty.isCollection()) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Property newProperty2 = DataCreator.createComplexCollection(propertyName, edmProperty
|
Property newProperty2 = DataCreator.createComplexCollection(propertyName);
|
||||||
.getType().getFullQualifiedName().getFullQualifiedNameAsString());
|
|
||||||
newProperty = newProperty2;
|
newProperty = newProperty2;
|
||||||
} else {
|
} else {
|
||||||
newProperty = DataCreator.createComplex(propertyName, edmProperty.getType()
|
newProperty = DataCreator.createComplex(propertyName);
|
||||||
.getFullQualifiedName().getFullQualifiedNameAsString());
|
|
||||||
createProperties((EdmComplexType) edmProperty.getType(), newProperty.asComplex().getValue());
|
createProperties((EdmComplexType) edmProperty.getType(), newProperty.asComplex().getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.apache.olingo.commons.core.data.EntitySetImpl;
|
||||||
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
|
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
|
||||||
import org.apache.olingo.server.api.uri.UriParameter;
|
import org.apache.olingo.server.api.uri.UriParameter;
|
||||||
import org.apache.olingo.server.tecsvc.data.DataProvider.DataProviderException;
|
import org.apache.olingo.server.tecsvc.data.DataProvider.DataProviderException;
|
||||||
import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
|
|
||||||
|
|
||||||
public class FunctionData {
|
public class FunctionData {
|
||||||
|
|
||||||
|
@ -81,12 +80,12 @@ public class FunctionData {
|
||||||
} else if (name.equals("UFCRTCollString")) {
|
} else if (name.equals("UFCRTCollString")) {
|
||||||
return data.get("ESCollAllPrim").getEntities().get(0).getProperty("CollPropertyString");
|
return data.get("ESCollAllPrim").getEntities().get(0).getProperty("CollPropertyString");
|
||||||
} else if (name.equals("UFCRTCTTwoPrim")) {
|
} else if (name.equals("UFCRTCTTwoPrim")) {
|
||||||
return DataCreator.createComplex(name, ComplexTypeProvider.nameCTTwoPrim.getFullQualifiedNameAsString(),
|
return DataCreator.createComplex(name,
|
||||||
DataCreator.createPrimitive("PropertyInt16", 16),
|
DataCreator.createPrimitive("PropertyInt16", 16),
|
||||||
DataCreator.createPrimitive("PropertyString", "UFCRTCTTwoPrim string value"));
|
DataCreator.createPrimitive("PropertyString", "UFCRTCTTwoPrim string value"));
|
||||||
} else if (name.equals("UFCRTCTTwoPrimParam")) {
|
} else if (name.equals("UFCRTCTTwoPrimParam")) {
|
||||||
try {
|
try {
|
||||||
return DataCreator.createComplex(name,ComplexTypeProvider.nameCTTwoPrim.getFullQualifiedNameAsString(),
|
return DataCreator.createComplex(name,
|
||||||
DataCreator.createPrimitive("PropertyInt16",
|
DataCreator.createPrimitive("PropertyInt16",
|
||||||
EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int16).valueOfString(
|
EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int16).valueOfString(
|
||||||
getParameterText("ParameterInt16", parameters),
|
getParameterText("ParameterInt16", parameters),
|
||||||
|
@ -100,7 +99,7 @@ public class FunctionData {
|
||||||
throw new DataProviderException("Error in function " + name + ".", e);
|
throw new DataProviderException("Error in function " + name + ".", e);
|
||||||
}
|
}
|
||||||
} else if (name.equals("UFCRTCollCTTwoPrim")) {
|
} else if (name.equals("UFCRTCollCTTwoPrim")) {
|
||||||
return DataCreator.createComplexCollection(name,ComplexTypeProvider.nameCTTwoPrim.getFullQualifiedNameAsString(),
|
return DataCreator.createComplexCollection(name,
|
||||||
Arrays.asList(DataCreator.createPrimitive("PropertyInt16", 16),
|
Arrays.asList(DataCreator.createPrimitive("PropertyInt16", 16),
|
||||||
DataCreator.createPrimitive("PropertyString", "Test123")),
|
DataCreator.createPrimitive("PropertyString", "Test123")),
|
||||||
Arrays.asList(DataCreator.createPrimitive("PropertyInt16", 17),
|
Arrays.asList(DataCreator.createPrimitive("PropertyInt16", 17),
|
||||||
|
|
Loading…
Reference in New Issue