From 2318953c26781e40b034f91781a5d9689ea3a14a Mon Sep 17 00:00:00 2001 From: Michael Bolz Date: Tue, 28 Apr 2015 12:52:14 +0200 Subject: [PATCH] [OLINGO-564] Renamed 'edm.provider.*' classes --- .../client/api/edm/xml/DataServices.java | 4 +- .../olingo/client/api/edm/xml/Reference.java | 4 +- .../client/api/edm/xml/XMLMetadata.java | 10 +- .../client/api/serialization/ODataReader.java | 4 +- .../retrieve/XMLMetadataRequestImpl.java | 18 +- .../client/core/edm/ClientEdmProvider.java | 117 ++-- .../client/core/edm/ClientXMLMetadata.java | 18 +- ...nnotatableDynamicAnnotationExpression.java | 10 +- .../AbstractClientAnnotationExpression.java | 4 +- .../client/core/edm/xml/ClientAction.java | 4 +- .../core/edm/xml/ClientActionImport.java | 4 +- .../client/core/edm/xml/ClientAnnotation.java | 8 +- .../core/edm/xml/ClientAnnotations.java | 4 +- .../core/edm/xml/ClientComplexType.java | 8 +- .../core/edm/xml/ClientDataServices.java | 10 +- .../client/core/edm/xml/ClientEdmx.java | 4 +- .../core/edm/xml/ClientEntityContainer.java | 4 +- .../client/core/edm/xml/ClientEntityKey.java | 10 +- .../client/core/edm/xml/ClientEntitySet.java | 8 +- .../client/core/edm/xml/ClientEntityType.java | 8 +- .../client/core/edm/xml/ClientEnumMember.java | 10 +- .../client/core/edm/xml/ClientEnumType.java | 4 +- .../client/core/edm/xml/ClientFunction.java | 4 +- .../core/edm/xml/ClientFunctionImport.java | 4 +- .../client/core/edm/xml/ClientInclude.java | 4 +- .../edm/xml/ClientIncludeAnnotations.java | 4 +- .../edm/xml/ClientNavigationProperty.java | 10 +- .../xml/ClientNavigationPropertyBinding.java | 13 +- .../client/core/edm/xml/ClientOnDelete.java | 14 +- .../client/core/edm/xml/ClientParameter.java | 4 +- .../client/core/edm/xml/ClientProperty.java | 4 +- .../core/edm/xml/ClientPropertyRef.java | 10 +- .../client/core/edm/xml/ClientReference.java | 10 +- .../edm/xml/ClientReferentialConstraint.java | 10 +- .../client/core/edm/xml/ClientReturnType.java | 4 +- .../client/core/edm/xml/ClientSchema.java | 4 +- .../client/core/edm/xml/ClientSingleton.java | 4 +- .../client/core/edm/xml/ClientTerm.java | 4 +- .../core/edm/xml/ClientTypeDefinition.java | 4 +- .../core/serialization/ODataReaderImpl.java | 4 +- .../olingo/client/core/uri/URIEscapeTest.java | 4 +- .../client/core/uri/v4/FilterFactoryTest.java | 4 +- .../olingo/client/core/v4/MetadataTest.java | 52 +- .../api/edm/provider/AbstractEdmProvider.java | 116 ---- ...tEdmItem.java => CsdlAbstractEdmItem.java} | 6 +- .../edm/provider/CsdlAbstractEdmProvider.java | 117 ++++ .../provider/{Action.java => CsdlAction.java} | 12 +- ...ctionImport.java => CsdlActionImport.java} | 10 +- .../{AliasInfo.java => CsdlAliasInfo.java} | 6 +- ...{Annotatable.java => CsdlAnnotatable.java} | 4 +- .../{Annotation.java => CsdlAnnotation.java} | 12 +- ...{Annotations.java => CsdlAnnotations.java} | 16 +- ...dingTarget.java => CsdlBindingTarget.java} | 20 +- ...{ComplexType.java => CsdlComplexType.java} | 16 +- .../api/edm/provider/CsdlEdmProvider.java | 179 ++++++ ...ontainer.java => CsdlEntityContainer.java} | 46 +- ...Info.java => CsdlEntityContainerInfo.java} | 6 +- .../{EntitySet.java => CsdlEntitySet.java} | 13 +- ...itySetPath.java => CsdlEntitySetPath.java} | 6 +- .../{EntityType.java => CsdlEntityType.java} | 24 +- .../{EnumMember.java => CsdlEnumMember.java} | 10 +- .../{EnumType.java => CsdlEnumType.java} | 32 +- .../{Expression.java => CsdlExpression.java} | 2 +- .../{Function.java => CsdlFunction.java} | 14 +- ...ionImport.java => CsdlFunctionImport.java} | 12 +- .../{Mapping.java => CsdlMapping.java} | 4 +- .../provider/{Named.java => CsdlNamed.java} | 2 +- ...perty.java => CsdlNavigationProperty.java} | 33 +- ...ava => CsdlNavigationPropertyBinding.java} | 6 +- .../{OnDelete.java => CsdlOnDelete.java} | 8 +- ...eteAction.java => CsdlOnDeleteAction.java} | 2 +- .../{Operation.java => CsdlOperation.java} | 26 +- ...onImport.java => CsdlOperationImport.java} | 10 +- .../{Parameter.java => CsdlParameter.java} | 30 +- .../{Property.java => CsdlProperty.java} | 36 +- ...{PropertyRef.java => CsdlPropertyRef.java} | 6 +- ...nt.java => CsdlReferentialConstraint.java} | 10 +- .../{ReturnType.java => CsdlReturnType.java} | 18 +- .../provider/{Schema.java => CsdlSchema.java} | 122 ++-- .../{Singleton.java => CsdlSingleton.java} | 11 +- ...turalType.java => CsdlStructuralType.java} | 32 +- .../edm/provider/{Term.java => CsdlTerm.java} | 30 +- ...efinition.java => CsdlTypeDefinition.java} | 22 +- .../commons/api/edm/provider/EdmProvider.java | 177 ------ .../api/edm/provider/annotation/Apply.java | 4 +- .../api/edm/provider/annotation/Cast.java | 4 +- .../api/edm/provider/annotation/If.java | 4 +- .../api/edm/provider/annotation/IsOf.java | 4 +- .../provider/annotation/LabeledElement.java | 4 +- .../api/edm/provider/annotation/Null.java | 4 +- .../provider/annotation/PropertyValue.java | 4 +- .../api/edm/provider/annotation/Record.java | 4 +- .../core/edm/AbstractEdmAnnotatable.java | 10 +- .../core/edm/AbstractEdmBindingTarget.java | 12 +- .../commons/core/edm/AbstractEdmNamed.java | 4 +- .../core/edm/AbstractEdmOperation.java | 16 +- .../core/edm/AbstractEdmOperationImport.java | 4 +- .../core/edm/AbstractEdmStructuredType.java | 18 +- .../commons/core/edm/EdmActionImpl.java | 4 +- .../commons/core/edm/EdmActionImportImpl.java | 6 +- .../commons/core/edm/EdmAnnotationImpl.java | 12 +- .../commons/core/edm/EdmAnnotationsImpl.java | 10 +- .../commons/core/edm/EdmComplexTypeImpl.java | 4 +- .../core/edm/EdmEntityContainerImpl.java | 54 +- .../commons/core/edm/EdmEntitySetImpl.java | 6 +- .../commons/core/edm/EdmEntityTypeImpl.java | 12 +- .../commons/core/edm/EdmEnumTypeImpl.java | 10 +- .../commons/core/edm/EdmFunctionImpl.java | 6 +- .../core/edm/EdmFunctionImportImpl.java | 7 +- .../core/edm/EdmKeyPropertyRefImpl.java | 6 +- .../commons/core/edm/EdmMemberImpl.java | 6 +- .../core/edm/EdmNavigationPropertyImpl.java | 16 +- .../commons/core/edm/EdmParameterImpl.java | 6 +- .../commons/core/edm/EdmPropertyImpl.java | 6 +- .../commons/core/edm/EdmProviderImpl.java | 98 ++-- .../edm/EdmReferentialConstraintImpl.java | 6 +- .../commons/core/edm/EdmReturnTypeImpl.java | 6 +- .../commons/core/edm/EdmSchemaImpl.java | 64 +-- .../commons/core/edm/EdmSingletonImpl.java | 4 +- .../olingo/commons/core/edm/EdmTermImpl.java | 6 +- .../core/edm/EdmTypeDefinitionImpl.java | 6 +- .../olingo/commons/core/edm/EdmTypeImpl.java | 4 +- .../org/apache/olingo/server/api/OData.java | 4 +- .../olingo/server/core/MetadataParser.java | 228 ++++---- .../server/core/SchemaBasedEdmProvider.java | 164 +++--- .../server/core/MetadataParserTest.java | 54 +- .../server/core/ServiceDispatcherTest.java | 8 +- .../olingo/server/example/TripPinServlet.java | 4 +- .../apache/olingo/server/core/ODataImpl.java | 4 +- .../server/core/ServiceMetadataImpl.java | 4 +- .../edm/provider/AbstractEdmNamedTest.java | 10 +- .../core/edm/provider/EdmActionImplTest.java | 20 +- .../edm/provider/EdmActionImportImplTest.java | 10 +- .../edm/provider/EdmComplexTypeImplTest.java | 38 +- .../provider/EdmEntityContainerImplTest.java | 75 +-- .../edm/provider/EdmEntitySetImplTest.java | 24 +- .../edm/provider/EdmEntityTypeImplTest.java | 132 ++--- .../server/core/edm/provider/EdmEnumTest.java | 40 +- .../edm/provider/EdmFunctionImplTest.java | 9 +- .../provider/EdmFunctionImportImplTest.java | 24 +- .../provider/EdmKeyPropertyRefImplTest.java | 18 +- .../core/edm/provider/EdmMappingTest.java | 16 +- .../core/edm/provider/EdmMemberImplTest.java | 4 +- .../EdmNavigationPropertyImplTest.java | 56 +- .../edm/provider/EdmParameterImplTest.java | 45 +- .../edm/provider/EdmPropertyImplTest.java | 45 +- .../EdmProviderImplOverloadingTest.java | 62 +-- .../edm/provider/EdmProviderImplTest.java | 40 +- .../edm/provider/EdmReturnTypeImplTest.java | 20 +- .../core/edm/provider/EdmSchemaImplTest.java | 143 ++--- .../edm/provider/EdmSingletonImplTest.java | 44 +- .../provider/EdmTypeDefinitionImplTest.java | 10 +- .../core/edm/provider/EdmTypeImplTest.java | 10 +- .../serializer/json/ComplexTypeHelper.java | 30 +- .../utils/ContextURLBuilderTest.java | 20 +- .../MetadataDocumentXmlSerializerTest.java | 139 ++--- .../tecsvc/provider/ActionProvider.java | 118 ++-- .../tecsvc/provider/ComplexTypeProvider.java | 48 +- .../tecsvc/provider/ContainerProvider.java | 489 ++++++++-------- .../tecsvc/provider/EdmTechProvider.java | 67 +-- .../tecsvc/provider/EntityTypeProvider.java | 178 +++--- .../tecsvc/provider/EnumTypeProvider.java | 14 +- .../tecsvc/provider/FunctionProvider.java | 524 ++++++++++-------- .../tecsvc/provider/PropertyProvider.java | 304 +++++----- .../tecsvc/provider/SchemaProvider.java | 32 +- .../provider/TypeDefinitionProvider.java | 6 +- .../olingo/server/core/ODataHandlerTest.java | 8 +- .../json/ODataJsonDeserializerEntityTest.java | 4 +- .../uri/testutil/EdmTechTestProvider.java | 36 +- .../sample/edmprovider/CarsEdmProvider.java | 97 ++-- 170 files changed, 2866 insertions(+), 2788 deletions(-) delete mode 100644 lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{AbstractEdmItem.java => CsdlAbstractEdmItem.java} (87%) create mode 100644 lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Action.java => CsdlAction.java} (78%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{ActionImport.java => CsdlActionImport.java} (82%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{AliasInfo.java => CsdlAliasInfo.java} (88%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Annotatable.java => CsdlAnnotatable.java} (92%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Annotation.java => CsdlAnnotation.java} (81%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Annotations.java => CsdlAnnotations.java} (74%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{BindingTarget.java => CsdlBindingTarget.java} (67%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{ComplexType.java => CsdlComplexType.java} (72%) create mode 100644 lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EntityContainer.java => CsdlEntityContainer.java} (62%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EntityContainerInfo.java => CsdlEntityContainerInfo.java} (85%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EntitySet.java => CsdlEntitySet.java} (77%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EntitySetPath.java => CsdlEntitySetPath.java} (87%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EntityType.java => CsdlEntityType.java} (69%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EnumMember.java => CsdlEnumMember.java} (79%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{EnumType.java => CsdlEnumType.java} (68%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Expression.java => CsdlExpression.java} (96%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Function.java => CsdlFunction.java} (76%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{FunctionImport.java => CsdlFunctionImport.java} (80%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Mapping.java => CsdlMapping.java} (93%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Named.java => CsdlNamed.java} (94%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{NavigationProperty.java => CsdlNavigationProperty.java} (66%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{NavigationPropertyBinding.java => CsdlNavigationPropertyBinding.java} (84%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{OnDelete.java => CsdlOnDelete.java} (81%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{OnDeleteAction.java => CsdlOnDeleteAction.java} (96%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Operation.java => CsdlOperation.java} (66%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{OperationImport.java => CsdlOperationImport.java} (77%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Parameter.java => CsdlParameter.java} (73%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Property.java => CsdlProperty.java} (73%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{PropertyRef.java => CsdlPropertyRef.java} (86%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{ReferentialConstraint.java => CsdlReferentialConstraint.java} (77%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{ReturnType.java => CsdlReturnType.java} (80%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Schema.java => CsdlSchema.java} (51%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Singleton.java => CsdlSingleton.java} (78%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{StructuralType.java => CsdlStructuralType.java} (65%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{Term.java => CsdlTerm.java} (74%) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/{TypeDefinition.java => CsdlTypeDefinition.java} (74%) delete mode 100644 lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java index d542cac44..99a9a70ab 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java @@ -20,7 +20,7 @@ package org.apache.olingo.client.api.edm.xml; import java.util.List; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; public interface DataServices { @@ -28,5 +28,5 @@ public interface DataServices { String getMaxDataServiceVersion(); - List getSchemas(); + List getSchemas(); } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java index d85fd6e08..8f24a91d0 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java @@ -21,9 +21,9 @@ package org.apache.olingo.client.api.edm.xml; import java.net.URI; import java.util.List; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface Reference extends Annotatable { +public interface Reference extends CsdlAnnotatable { URI getUri(); diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java index c1231a129..74191cf53 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java @@ -21,7 +21,7 @@ package org.apache.olingo.client.api.edm.xml; import java.util.List; import java.util.Map; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; /** * Entry point for access information about EDM metadata. @@ -34,7 +34,7 @@ public interface XMLMetadata { * @param index index of the Schema to return * @return the Schema at the specified position in the EdM metadata document */ - Schema getSchema(final int index); + CsdlSchema getSchema(final int index); /** * Returns the Schema with the specified key (namespace or alias) in the EdM metadata document. @@ -42,16 +42,16 @@ public interface XMLMetadata { * @param key namespace or alias * @return the Schema with the specified key in the EdM metadata document */ - Schema getSchema(final String key); + CsdlSchema getSchema(final String key); /** * Returns all Schema objects defined in the EdM metadata document. * * @return all Schema objects defined in the EdM metadata document */ - List getSchemas(); + List getSchemas(); - Map getSchemaByNsOrAlias(); + Map getSchemaByNsOrAlias(); List getReferences(); } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java index e89534130..063467357 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java @@ -28,7 +28,7 @@ import org.apache.olingo.commons.api.domain.ODataError; import org.apache.olingo.commons.api.domain.ODataProperty; import org.apache.olingo.commons.api.domain.ODataServiceDocument; import org.apache.olingo.commons.api.edm.Edm; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; @@ -55,7 +55,7 @@ public interface ODataReader { * <edmx:Reference/>) metadata document * @return metadata representation. */ - Edm readMetadata(Map xmlSchemas); + Edm readMetadata(Map xmlSchemas); /** * Parses an OData service document. diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java index 304c1bc03..ff49b7bb0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java @@ -31,9 +31,9 @@ import org.apache.olingo.client.api.edm.xml.Include; import org.apache.olingo.client.api.edm.xml.IncludeAnnotations; import org.apache.olingo.client.api.edm.xml.Reference; import org.apache.olingo.client.api.edm.xml.XMLMetadata; -import org.apache.olingo.commons.api.edm.provider.Annotation; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; import org.apache.olingo.commons.api.format.ODataFormat; public class XMLMetadataRequestImpl @@ -62,7 +62,7 @@ public class XMLMetadataRequestImpl // edmx:Include for (Include include : reference.getIncludes()) { - final Schema includedSchema = includeMetadata.getSchema(include.getNamespace()); + final CsdlSchema includedSchema = includeMetadata.getSchema(include.getNamespace()); if (includedSchema != null) { response.getBody().getSchemas().add(includedSchema); if (StringUtils.isNotBlank(include.getAlias())) { @@ -73,14 +73,14 @@ public class XMLMetadataRequestImpl // edmx:IncludeAnnotations for (IncludeAnnotations include : reference.getIncludeAnnotations()) { - for (Schema schema : includeMetadata.getSchemas()) { + for (CsdlSchema schema : includeMetadata.getSchemas()) { // create empty schema that will be fed with edm:Annotations that match the criteria in IncludeAnnotations - final Schema forInclusion = new Schema(); + final CsdlSchema forInclusion = new CsdlSchema(); forInclusion.setNamespace(schema.getNamespace()); forInclusion.setAlias(schema.getAlias()); // process all edm:Annotations in each schema of the included document - for (Annotations annotationGroup : schema.getAnnotationGroups()) { + for (CsdlAnnotations annotationGroup : schema.getAnnotationGroups()) { // take into account only when (TargetNamespace was either not provided or matches) and // (Qualifier was either not provided or matches) if ((StringUtils.isBlank(include.getTargetNamespace()) @@ -89,11 +89,11 @@ public class XMLMetadataRequestImpl && (StringUtils.isBlank(include.getQualifier()) || include.getQualifier().equals(annotationGroup.getQualifier()))) { - final Annotations toBeIncluded = new Annotations(); + final CsdlAnnotations toBeIncluded = new CsdlAnnotations(); toBeIncluded.setTarget(annotationGroup.getTarget()); toBeIncluded.setQualifier(annotationGroup.getQualifier()); // only import annotations with terms matching the given TermNamespace - for (Annotation annotation : annotationGroup.getAnnotations()) { + for (CsdlAnnotation annotation : annotationGroup.getAnnotations()) { if (include.getTermNamespace().equals(StringUtils.substringBeforeLast(annotation.getTerm(), "."))) { toBeIncluded.getAnnotations().add(annotation); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java index b062447b4..6284aded2 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java @@ -24,36 +24,36 @@ import java.util.Map; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; -public class ClientEdmProvider extends AbstractEdmProvider { +public class ClientEdmProvider extends CsdlAbstractEdmProvider { - private final Map xmlSchemas; + private final Map xmlSchemas; - public ClientEdmProvider(Map xmlSchemas) { + public ClientEdmProvider(Map xmlSchemas) { this.xmlSchemas = xmlSchemas; } @Override - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { - Schema schema = xmlSchemas.get(enumTypeName.getNamespace()); + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(enumTypeName.getNamespace()); if (schema != null) { return schema.getEnumType(enumTypeName.getName()); } @@ -61,8 +61,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { - Schema schema = xmlSchemas.get(typeDefinitionName.getNamespace()); + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(typeDefinitionName.getNamespace()); if (schema != null) { return schema.getTypeDefinition(typeDefinitionName.getName()); } @@ -70,8 +70,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { - Schema schema = xmlSchemas.get(entityTypeName.getNamespace()); + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(entityTypeName.getNamespace()); if (schema != null) { return schema.getEntityType(entityTypeName.getName()); } @@ -79,8 +79,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { - Schema schema = xmlSchemas.get(complexTypeName.getNamespace()); + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(complexTypeName.getNamespace()); if (schema != null) { return schema.getComplexType(complexTypeName.getName()); } @@ -88,8 +88,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public List getActions(final FullQualifiedName actionName) throws ODataException { - Schema schema = xmlSchemas.get(actionName.getNamespace()); + public List getActions(final FullQualifiedName actionName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(actionName.getNamespace()); if (schema != null) { return schema.getActions(actionName.getName()); } @@ -97,8 +97,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public List getFunctions(final FullQualifiedName functionName) throws ODataException { - Schema schema = xmlSchemas.get(functionName.getNamespace()); + public List getFunctions(final FullQualifiedName functionName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(functionName.getNamespace()); if (schema != null) { return schema.getFunctions(functionName.getName()); } @@ -106,8 +106,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public Term getTerm(final FullQualifiedName termName) throws ODataException { - Schema schema = xmlSchemas.get(termName.getNamespace()); + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(termName.getNamespace()); if (schema != null) { return schema.getTerm(termName.getName()); } @@ -115,9 +115,9 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { - Schema schema = xmlSchemas.get(entityContainer.getNamespace()); + CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace()); if (schema != null) { return schema.getEntityContainer().getEntitySet(entitySetName); } @@ -125,9 +125,9 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) throws ODataException { - Schema schema = xmlSchemas.get(entityContainer.getNamespace()); + CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace()); if (schema != null) { return schema.getEntityContainer().getSingleton(singletonName); } @@ -135,9 +135,9 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) throws ODataException { - Schema schema = xmlSchemas.get(entityContainer.getNamespace()); + CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace()); if (schema != null) { return schema.getEntityContainer().getActionImport(actionImportName); } @@ -145,9 +145,9 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) throws ODataException { - Schema schema = xmlSchemas.get(entityContainer.getNamespace()); + CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace()); if (schema != null) { return schema.getEntityContainer().getFunctionImport(functionImportName); } @@ -155,10 +155,11 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { - for (Schema schema : xmlSchemas.values()) { + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException { + for (CsdlSchema schema : xmlSchemas.values()) { if (schema.getEntityContainer() != null) { - return new EntityContainerInfo().setContainerName(entityContainerName).setExtendsContainer( + return new CsdlEntityContainerInfo().setContainerName(entityContainerName).setExtendsContainer( schema.getEntityContainer().getExtendsContainerFQN()); } } @@ -166,24 +167,24 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public List getAliasInfos() throws ODataException { - ArrayList aliasInfo = new ArrayList(); - for (Schema schema : xmlSchemas.values()) { + public List getAliasInfos() throws ODataException { + ArrayList aliasInfo = new ArrayList(); + for (CsdlSchema schema : xmlSchemas.values()) { if (schema.getAlias() != null) { - aliasInfo.add(new AliasInfo().setNamespace(schema.getNamespace()).setAlias(schema.getAlias())); + aliasInfo.add(new CsdlAliasInfo().setNamespace(schema.getNamespace()).setAlias(schema.getAlias())); } } return aliasInfo; } @Override - public List getSchemas() throws ODataException { - return new ArrayList(xmlSchemas.values()); + public List getSchemas() throws ODataException { + return new ArrayList(xmlSchemas.values()); } @Override - public EntityContainer getEntityContainer() throws ODataException { - for (Schema schema : xmlSchemas.values()) { + public CsdlEntityContainer getEntityContainer() throws ODataException { + for (CsdlSchema schema : xmlSchemas.values()) { if (schema.getEntityContainer() != null) { return schema.getEntityContainer(); } @@ -192,8 +193,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { - Schema schema = xmlSchemas.get(targetName.getNamespace()); + public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { + CsdlSchema schema = xmlSchemas.get(targetName.getNamespace()); if (schema != null) { return schema.getAnnotationGroup(targetName.getName()); } @@ -201,8 +202,8 @@ public class ClientEdmProvider extends AbstractEdmProvider { } @Override - public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { - final Schema schema = xmlSchemas.get(annotatedName.getNamespace()); + public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { + final CsdlSchema schema = xmlSchemas.get(annotatedName.getNamespace()); if (schema != null) { return schema.getAnnotatables().get(annotatedName.getName()); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java index 661750d9f..96c07c26e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java @@ -26,13 +26,13 @@ import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.edm.xml.Edmx; import org.apache.olingo.client.api.edm.xml.Reference; import org.apache.olingo.client.api.edm.xml.XMLMetadata; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; /** * Entry point for access information about EDM metadata. */ -public class ClientXMLMetadata extends AbstractEdmItem implements XMLMetadata { +public class ClientXMLMetadata extends CsdlAbstractEdmItem implements XMLMetadata { private static final long serialVersionUID = 6025723060298454901L; protected final Edmx edmx; @@ -42,24 +42,24 @@ public class ClientXMLMetadata extends AbstractEdmItem implements XMLMetadata { } @Override - public List getSchemas() { + public List getSchemas() { return this.edmx.getDataServices().getSchemas(); } @Override - public Schema getSchema(final int index) { + public CsdlSchema getSchema(final int index) { return getSchemas().get(index); } @Override - public Schema getSchema(final String key) { + public CsdlSchema getSchema(final String key) { return getSchemaByNsOrAlias().get(key); } @Override - public Map getSchemaByNsOrAlias() { - final Map schemaByNsOrAlias = new HashMap(); - for (Schema schema : getSchemas()) { + public Map getSchemaByNsOrAlias() { + final Map schemaByNsOrAlias = new HashMap(); + for (CsdlSchema schema : getSchemas()) { schemaByNsOrAlias.put(schema.getNamespace(), schema); if (StringUtils.isNotBlank(schema.getAlias())) { schemaByNsOrAlias.put(schema.getAlias(), schema); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java index 614ca1f01..052c4c7a1 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java @@ -21,18 +21,18 @@ package org.apache.olingo.client.core.edm.xml; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; abstract class AbstractClientAnnotatableDynamicAnnotationExpression - extends AbstractClientDynamicAnnotationExpression implements Annotatable { + extends AbstractClientDynamicAnnotationExpression implements CsdlAnnotatable { private static final long serialVersionUID = -450668773857358139L; - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java index 4bc802f60..bcdaf40eb 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java @@ -18,12 +18,12 @@ */ package org.apache.olingo.client.core.edm.xml; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; -abstract class AbstractClientAnnotationExpression extends AbstractEdmItem implements AnnotationExpression { +abstract class AbstractClientAnnotationExpression extends CsdlAbstractEdmItem implements AnnotationExpression { private static final long serialVersionUID = -4238652997159205377L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java index ceedc2568..af274c586 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java @@ -22,14 +22,14 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientAction.ActionDeserializer.class) -class ClientAction extends Action { +class ClientAction extends CsdlAction { private static final long serialVersionUID = 5321541275349234088L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java index 4be630567..24193323c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; import java.io.IOException; @JsonDeserialize(using = ClientActionImport.ActionImportDeserializer.class) -class ClientActionImport extends ActionImport { +class ClientActionImport extends CsdlActionImport { private static final long serialVersionUID = 2971468441177647068L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java index cb27d0b51..a8a978a31 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java @@ -23,19 +23,19 @@ import java.io.IOException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ClientAnnotation.AnnotationDeserializer.class) -class ClientAnnotation extends Annotation { +class ClientAnnotation extends CsdlAnnotation { private static final long serialVersionUID = 5464714417411058033L; - static class AnnotationDeserializer extends AbstractClientEdmDeserializer { + static class AnnotationDeserializer extends AbstractClientEdmDeserializer { @Override - protected Annotation doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlAnnotation doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ClientAnnotation annotation = new ClientAnnotation(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java index 561fcfd82..d395706f0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java @@ -21,14 +21,14 @@ package org.apache.olingo.client.core.edm.xml; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -import org.apache.olingo.commons.api.edm.provider.Annotations; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientAnnotations.AnnotationsDeserializer.class) -class ClientAnnotations extends Annotations { +class ClientAnnotations extends CsdlAnnotations { private static final long serialVersionUID = -5961207981571644200L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java index 875b56f20..1f6e6de69 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientComplexType.ComplexTypeDeserializer.class) -class ClientComplexType extends ComplexType { +class ClientComplexType extends CsdlComplexType { private static final long serialVersionUID = 4076944306925840115L; - static class ComplexTypeDeserializer extends AbstractClientEdmDeserializer { + static class ComplexTypeDeserializer extends AbstractClientEdmDeserializer { @Override - protected ComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ClientComplexType complexType = new ClientComplexType(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java index 3292b345f..d4a44062d 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java @@ -26,17 +26,17 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.olingo.client.api.edm.xml.DataServices; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ClientDataServices.DataServicesDeserializer.class) -class ClientDataServices extends AbstractEdmItem implements DataServices { +class ClientDataServices extends CsdlAbstractEdmItem implements DataServices { private static final long serialVersionUID = 4200317286476885204L; - private final List schemas = new ArrayList(); + private final List schemas = new ArrayList(); private String dataServiceVersion; @@ -61,7 +61,7 @@ class ClientDataServices extends AbstractEdmItem implements DataServices { } @Override - public List getSchemas() { + public List getSchemas() { return schemas; } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java index 29a399c55..736030b30 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java @@ -28,12 +28,12 @@ import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.olingo.client.api.edm.xml.DataServices; import org.apache.olingo.client.api.edm.xml.Edmx; import org.apache.olingo.client.api.edm.xml.Reference; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ClientEdmx.EdmxDeserializer.class) -public class ClientEdmx extends AbstractEdmItem implements Edmx { +public class ClientEdmx extends CsdlAbstractEdmItem implements Edmx { private static final long serialVersionUID = -6293476719276092572L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java index 6efbf3442..2109cee8e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java @@ -21,14 +21,14 @@ package org.apache.olingo.client.core.edm.xml; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientEntityContainer.EntityContainerDeserializer.class) -class ClientEntityContainer extends EntityContainer { +class ClientEntityContainer extends CsdlEntityContainer { private static final long serialVersionUID = 5631432527646955795L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java index 6e2a137e8..6b9e230e8 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java @@ -25,19 +25,19 @@ import java.util.List; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ClientEntityKey.EntityKeyDeserializer.class) -class ClientEntityKey extends AbstractEdmItem { +class ClientEntityKey extends CsdlAbstractEdmItem { private static final long serialVersionUID = 520227585458843347L; - private final List propertyRefs = new ArrayList(); + private final List propertyRefs = new ArrayList(); - public List getPropertyRefs() { + public List getPropertyRefs() { return propertyRefs; } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java index 11d3cde34..ca358cbbe 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java @@ -22,20 +22,20 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientEntitySet.EntitySetDeserializer.class) -class ClientEntitySet extends EntitySet { +class ClientEntitySet extends CsdlEntitySet { private static final long serialVersionUID = -5553885465204370676L; - static class EntitySetDeserializer extends AbstractClientEdmDeserializer { + static class EntitySetDeserializer extends AbstractClientEdmDeserializer { @Override - protected EntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ClientEntitySet entitySet = new ClientEntitySet(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java index 4e1e7eb98..ceef35e95 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java @@ -22,20 +22,20 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientEntityType.EntityTypeDeserializer.class) -class ClientEntityType extends EntityType { +class ClientEntityType extends CsdlEntityType { private static final long serialVersionUID = -3986417775876689669L; - static class EntityTypeDeserializer extends AbstractClientEdmDeserializer { + static class EntityTypeDeserializer extends AbstractClientEdmDeserializer { @Override - protected EntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ClientEntityType entityType = new ClientEntityType(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java index 603e7fe1f..b72e2df9f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; import java.io.IOException; @JsonDeserialize(using = ClientEnumMember.EnumMemberDeserializer.class) -class ClientEnumMember extends EnumMember { +class ClientEnumMember extends CsdlEnumMember { private static final long serialVersionUID = -6138606817225829791L; - static class EnumMemberDeserializer extends AbstractClientEdmDeserializer { + static class EnumMemberDeserializer extends AbstractClientEdmDeserializer { @Override - protected EnumMember doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlEnumMember doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { - final EnumMember member = new EnumMember(); + final CsdlEnumMember member = new CsdlEnumMember(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java index 4abaebb25..e64f1c827 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java @@ -22,14 +22,14 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientEnumType.EnumTypeDeserializer.class) -class ClientEnumType extends EnumType { +class ClientEnumType extends CsdlEnumType { private static final long serialVersionUID = 9191189755592743333L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java index 7901399d9..c07b37ed1 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java @@ -22,14 +22,14 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientFunction.FunctionDeserializer.class) -class ClientFunction extends Function { +class ClientFunction extends CsdlFunction { private static final long serialVersionUID = -5494898295282843362L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java index 86bce9c23..25c3a91e5 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java @@ -22,14 +22,14 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientFunctionImport.FunctionImportDeserializer.class) -class ClientFunctionImport extends FunctionImport { +class ClientFunctionImport extends CsdlFunctionImport { private static final long serialVersionUID = -1686801084142932402L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java index 4bc807554..fafd3a483 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java @@ -23,12 +23,12 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.apache.olingo.client.api.edm.xml.Include; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; import java.io.IOException; @JsonDeserialize(using = ClientInclude.IncludeDeserializer.class) -class ClientInclude extends AbstractEdmItem implements Include { +class ClientInclude extends CsdlAbstractEdmItem implements Include { private static final long serialVersionUID = -5450008299655584221L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java index 30ddccc23..3617c6593 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java @@ -23,12 +23,12 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.apache.olingo.client.api.edm.xml.IncludeAnnotations; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; import java.io.IOException; @JsonDeserialize(using = ClientIncludeAnnotations.IncludeAnnotationsDeserializer.class) -class ClientIncludeAnnotations extends AbstractEdmItem implements IncludeAnnotations { +class ClientIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnnotations { private static final long serialVersionUID = -8157841387011422396L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java index 2c561c7de..5b0af33fb 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java @@ -22,24 +22,24 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientNavigationProperty.NavigationPropertyDeserializer.class) -class ClientNavigationProperty extends NavigationProperty { +class ClientNavigationProperty extends CsdlNavigationProperty { private static final long serialVersionUID = 6240231735592427582L; - static class NavigationPropertyDeserializer extends AbstractClientEdmDeserializer { + static class NavigationPropertyDeserializer extends AbstractClientEdmDeserializer { @Override - protected NavigationProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlNavigationProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { - final NavigationProperty property = new ClientNavigationProperty(); + final CsdlNavigationProperty property = new ClientNavigationProperty(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java index fffe729a7..250c7691d 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java @@ -22,30 +22,31 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; import java.io.IOException; @JsonDeserialize(using = ClientNavigationPropertyBinding.NavigationPropertyBindingDeserializer.class) -class ClientNavigationPropertyBinding extends NavigationPropertyBinding { +class ClientNavigationPropertyBinding extends CsdlNavigationPropertyBinding { private static final long serialVersionUID = -7056978592235483660L; @Override - public NavigationPropertyBinding setPath(final String path) { + public CsdlNavigationPropertyBinding setPath(final String path) { super.setPath(path); return this; } @Override - public NavigationPropertyBinding setTarget(final String target) { + public CsdlNavigationPropertyBinding setTarget(final String target) { super.setTarget(target); return this; } - static class NavigationPropertyBindingDeserializer extends AbstractClientEdmDeserializer { + static class NavigationPropertyBindingDeserializer extends + AbstractClientEdmDeserializer { @Override - protected NavigationPropertyBinding doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlNavigationPropertyBinding doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ClientNavigationPropertyBinding member = new ClientNavigationPropertyBinding(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java index bd3859560..489326d76 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java @@ -22,28 +22,28 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.olingo.commons.api.edm.provider.OnDelete; -import org.apache.olingo.commons.api.edm.provider.OnDeleteAction; +import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete; +import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction; import java.io.IOException; @JsonDeserialize(using = ClientOnDelete.OnDeleteDeserializer.class) -class ClientOnDelete extends OnDelete { +class ClientOnDelete extends CsdlOnDelete { private static final long serialVersionUID = -7130889202653716784L; - static class OnDeleteDeserializer extends AbstractClientEdmDeserializer { + static class OnDeleteDeserializer extends AbstractClientEdmDeserializer { @Override - protected OnDelete doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlOnDelete doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { - final OnDelete ondelete = new ClientOnDelete(); + final CsdlOnDelete ondelete = new ClientOnDelete(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Action".equals(jp.getCurrentName())) { - OnDeleteAction action = OnDeleteAction.valueOf(jp.nextTextValue()); + CsdlOnDeleteAction action = CsdlOnDeleteAction.valueOf(jp.nextTextValue()); ondelete.setAction(action); } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java index be2ecea6d..24e865096 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java @@ -23,14 +23,14 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientParameter.ParameterDeserializer.class) -class ClientParameter extends Parameter { +class ClientParameter extends CsdlParameter { private static final long serialVersionUID = 7119478691341167904L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java index 7389d67c9..d753fd458 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java @@ -23,14 +23,14 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientProperty.PropertyDeserializer.class) -class ClientProperty extends Property { +class ClientProperty extends CsdlProperty { private static final long serialVersionUID = -4521766603286651372L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java index 3f1c8e30e..17bdc3388 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; import java.io.IOException; @JsonDeserialize(using = ClientPropertyRef.PropertyRefDeserializer.class) -class ClientPropertyRef extends PropertyRef { +class ClientPropertyRef extends CsdlPropertyRef { private static final long serialVersionUID = 1504095609268590326L; - static class PropertyRefDeserializer extends AbstractClientEdmDeserializer { + static class PropertyRefDeserializer extends AbstractClientEdmDeserializer { @Override - protected PropertyRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlPropertyRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { - final PropertyRef propertyRef = new ClientPropertyRef(); + final CsdlPropertyRef propertyRef = new ClientPropertyRef(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java index a172405d3..36b43d6dc 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java @@ -29,23 +29,23 @@ import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.olingo.client.api.edm.xml.Include; import org.apache.olingo.client.api.edm.xml.IncludeAnnotations; import org.apache.olingo.client.api.edm.xml.Reference; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ClientReference.ReferenceDeserializer.class) -class ClientReference extends AbstractEdmItem implements Reference { +class ClientReference extends CsdlAbstractEdmItem implements Reference { private static final long serialVersionUID = 7720274712545267654L; private URI uri; private final List includes = new ArrayList(); private final List includeAnnotations = new ArrayList(); - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java index 04b554d2d..e6135636d 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint; import java.io.IOException; @JsonDeserialize(using = ClientReferentialConstraint.ReferentialConstraintDeserializer.class) -class ClientReferentialConstraint extends ReferentialConstraint { +class ClientReferentialConstraint extends CsdlReferentialConstraint { private static final long serialVersionUID = -5822115908069878139L; - static class ReferentialConstraintDeserializer extends AbstractClientEdmDeserializer { + static class ReferentialConstraintDeserializer extends AbstractClientEdmDeserializer { @Override - protected ReferentialConstraint doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected CsdlReferentialConstraint doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { - final ReferentialConstraint refConst = new ClientReferentialConstraint(); + final CsdlReferentialConstraint refConst = new ClientReferentialConstraint(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java index 987d3743b..72db23fc9 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java @@ -23,14 +23,14 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientReturnType.ReturnTypeDeserializer.class) -class ClientReturnType extends ReturnType { +class ClientReturnType extends CsdlReturnType { private static final long serialVersionUID = 6261092793901735110L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java index 5846b3614..a4a0dd7d9 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java @@ -21,14 +21,14 @@ package org.apache.olingo.client.core.edm.xml; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientSchema.SchemaDeserializer.class) -class ClientSchema extends Schema { +class ClientSchema extends CsdlSchema { private static final long serialVersionUID = 1911087363912024939L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java index cba4b3246..a06d6e854 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java @@ -21,14 +21,14 @@ package org.apache.olingo.client.core.edm.xml; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientSingleton.SingletonDeserializer.class) -class ClientSingleton extends Singleton { +class ClientSingleton extends CsdlSingleton { private static final long serialVersionUID = 1656749615107151921L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java index ed78e0304..f0904dd18 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java @@ -24,7 +24,7 @@ import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -32,7 +32,7 @@ import java.io.IOException; import java.util.Arrays; @JsonDeserialize(using = ClientTerm.TermDeserializer.class) -class ClientTerm extends Term { +class ClientTerm extends CsdlTerm { private static final long serialVersionUID = -8350072064720586186L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java index e0dd12bdc..fd79ec4a0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java @@ -23,14 +23,14 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientTypeDefinition.TypeDefinitionDeserializer.class) -class ClientTypeDefinition extends TypeDefinition { +class ClientTypeDefinition extends CsdlTypeDefinition { private static final long serialVersionUID = -902407149079419602L; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java index f153ddb50..c1b4e7cc0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java @@ -41,7 +41,7 @@ import org.apache.olingo.commons.api.domain.ODataServiceDocument; import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; import org.apache.olingo.commons.core.edm.EdmProviderImpl; @@ -67,7 +67,7 @@ public class ODataReaderImpl implements ODataReader { } @Override - public Edm readMetadata(final Map xmlSchemas) { + public Edm readMetadata(final Map xmlSchemas) { ClientEdmProvider prov = new ClientEdmProvider(xmlSchemas); return new EdmProviderImpl(prov); } diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java index 2245a1432..aad1dc7f5 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java @@ -32,7 +32,7 @@ import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.Geospatial; import org.apache.olingo.commons.api.edm.geo.Point; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import org.apache.olingo.commons.core.edm.EdmEnumTypeImpl; import org.junit.Test; @@ -51,7 +51,7 @@ public class URIEscapeTest { @Test public void _enum() throws UnsupportedEncodingException { final EdmEnumType pattern = - new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new EnumType()); + new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new CsdlEnumType()); assertEquals("Sales.Pattern'Yellow'", URIUtils.escape( pattern.toUriLiteral("Yellow"))); } diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java index aa94a8051..eff892e28 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java @@ -33,7 +33,7 @@ import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import org.apache.olingo.commons.core.edm.EdmEnumTypeImpl; import org.junit.Test; @@ -55,7 +55,7 @@ public class FilterFactoryTest extends AbstractTest { @Test public void has() { final EdmEnumType pattern = - new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new EnumType()); + new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new CsdlEnumType()); final URIFilter filter = getFilterFactory().has(getFilterArgFactory().property("style"), pattern, "Yellow"); assertEquals("(style has Sales.Pattern'Yellow')", filter.build()); diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java index 19b6881e1..8d359a749 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java @@ -48,16 +48,16 @@ import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.annotation.EdmUrlRef; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Annotation; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; import org.apache.olingo.commons.api.edm.provider.annotation.Apply; import org.apache.olingo.commons.api.edm.provider.annotation.Collection; import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; @@ -145,7 +145,7 @@ public class MetadataTest extends AbstractTest { assertNotNull(metadata); assertFalse(metadata.getSchema(0).getAnnotationGroups().isEmpty()); - final Annotations annots = metadata.getSchema(0).getAnnotationGroup("ODataDemo.DemoService/Suppliers"); + final CsdlAnnotations annots = metadata.getSchema(0).getAnnotationGroup("ODataDemo.DemoService/Suppliers"); assertNotNull(annots); assertFalse(annots.getAnnotations().isEmpty()); assertEquals(ConstantAnnotationExpression.Type.String, @@ -185,13 +185,13 @@ public class MetadataTest extends AbstractTest { toMetadata(getClass().getResourceAsStream("northwind-metadata.xml")); assertNotNull(metadata); - final Schema first = metadata.getSchema("NorthwindModel"); + final CsdlSchema first = metadata.getSchema("NorthwindModel"); assertNotNull(first); - final Schema second = metadata.getSchema("ODataWebExperimental.Northwind.Model"); + final CsdlSchema second = metadata.getSchema("ODataWebExperimental.Northwind.Model"); assertNotNull(second); - final EntityContainer entityContainer = second.getEntityContainer(); + final CsdlEntityContainer entityContainer = second.getEntityContainer(); assertNotNull(entityContainer); assertEquals("NorthwindEntities", entityContainer.getName()); } @@ -208,31 +208,31 @@ public class MetadataTest extends AbstractTest { assertFalse(metadata.getReferences().isEmpty()); assertEquals("Org.OData.Measures.V1", metadata.getReferences().get(1).getIncludes().get(0).getNamespace()); - final EntityType product = metadata.getSchema(0).getEntityType("Product"); + final CsdlEntityType product = metadata.getSchema(0).getEntityType("Product"); assertTrue(product.hasStream()); assertEquals("UoM.ISOCurrency", product.getProperty("Price").getAnnotations().get(0).getTerm()); assertEquals("Products", product.getNavigationProperty("Supplier").getPartner()); - final EntityType category = metadata.getSchema(0).getEntityType("Category"); + final CsdlEntityType category = metadata.getSchema(0).getEntityType("Category"); assertNotNull(category); - final ComplexType address = metadata.getSchema(0).getComplexType("Address"); + final CsdlComplexType address = metadata.getSchema(0).getComplexType("Address"); assertFalse(address.getNavigationProperty("Country").getReferentialConstraints().isEmpty()); assertEquals("Name", address.getNavigationProperty("Country").getReferentialConstraints().get(0).getReferencedProperty()); - final Function productsByRating = metadata.getSchema(0).getFunctions("ProductsByRating").get(0); + final CsdlFunction productsByRating = metadata.getSchema(0).getFunctions("ProductsByRating").get(0); assertNotNull(productsByRating.getParameter("Rating")); assertEquals("Edm.Int32", productsByRating.getParameter("Rating").getType()); assertEquals("ODataDemo.Product", productsByRating.getReturnType().getType()); assertTrue(productsByRating.getReturnType().isCollection()); - final Singleton contoso = metadata.getSchema(0).getEntityContainer().getSingleton("Contoso"); + final CsdlSingleton contoso = metadata.getSchema(0).getEntityContainer().getSingleton("Contoso"); assertNotNull(contoso); assertFalse(contoso.getNavigationPropertyBindings().isEmpty()); assertEquals("Products", contoso.getNavigationPropertyBindings().get(0).getPath()); - final FunctionImport functionImport = metadata.getSchema(0).getEntityContainer(). + final CsdlFunctionImport functionImport = metadata.getSchema(0).getEntityContainer(). getFunctionImport("ProductsByRating"); assertNotNull(functionImport); assertEquals(metadata.getSchema(0).getNamespace() + "." + productsByRating.getName(), @@ -286,7 +286,7 @@ public class MetadataTest extends AbstractTest { assertNotNull(metadata); // Check displayName - final Annotation displayName = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Supplier"). + final CsdlAnnotation displayName = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Supplier"). getAnnotation("Vocabulary1.DisplayName"); assertNotNull(displayName); assertTrue(displayName.getExpression().isDynamic()); @@ -308,7 +308,7 @@ public class MetadataTest extends AbstractTest { assertEquals("Address/CountryName", thirdArg.getValue()); // Check Tags - final Annotation tags = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Product"). + final CsdlAnnotation tags = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Product"). getAnnotation("Vocabulary1.Tags"); assertNotNull(tags); assertTrue(tags.getExpression().isDynamic()); @@ -347,10 +347,10 @@ public class MetadataTest extends AbstractTest { toMetadata(getClass().getResourceAsStream("fromdoc4-metadata.xml")); assertNotNull(metadata); - final Annotations group = metadata.getSchema(0).getAnnotationGroups().get(0); + final CsdlAnnotations group = metadata.getSchema(0).getAnnotationGroups().get(0); assertNotNull(group); - Annotation annotation = group.getAnnotations().get(0); + CsdlAnnotation annotation = group.getAnnotations().get(0); assertTrue(annotation.getExpression().isDynamic()); assertTrue(annotation.getExpression().asDynamic().isCast()); assertEquals("Edm.Decimal", annotation.getExpression().asDynamic().asCast().getType()); @@ -402,11 +402,11 @@ public class MetadataTest extends AbstractTest { final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML). toMetadata(input); - Schema schema = metadata.getSchema("Capabilities"); + CsdlSchema schema = metadata.getSchema("Capabilities"); assertNotNull(schema); assertEquals(23, schema.getTerms().size()); - final Term deleteRestrictions = schema.getTerm("DeleteRestrictions"); + final CsdlTerm deleteRestrictions = schema.getTerm("DeleteRestrictions"); assertNotNull(deleteRestrictions); assertEquals("Capabilities.DeleteRestrictionsType", deleteRestrictions.getType()); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java deleted file mode 100644 index d1ada554d..000000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.commons.api.edm.provider; - -import java.util.List; - -import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -public abstract class AbstractEdmProvider implements EdmProvider { - - @Override - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { - return null; - } - - @Override - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { - return null; - } - - @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { - return null; - } - - @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { - return null; - } - - @Override - public List getActions(final FullQualifiedName actionName) throws ODataException { - return null; - } - - @Override - public List getFunctions(final FullQualifiedName functionName) throws ODataException { - return null; - } - - @Override - public Term getTerm(final FullQualifiedName termName) throws ODataException { - return null; - } - - @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) - throws ODataException { - return null; - } - - @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) - throws ODataException { - return null; - } - - @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) - throws ODataException { - return null; - } - - @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) - throws ODataException { - return null; - } - - @Override - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { - return null; - } - - @Override - public List getAliasInfos() throws ODataException { - return null; - } - - @Override - public List getSchemas() throws ODataException { - return null; - } - - @Override - public EntityContainer getEntityContainer() throws ODataException { - return null; - } - - @Override - public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { - return null; - } - - @Override - public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { - return null; - } -} diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java similarity index 87% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java index 0c375ae0e..0b029474f 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java @@ -28,16 +28,16 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -public abstract class AbstractEdmItem implements Serializable { +public abstract class CsdlAbstractEdmItem implements Serializable { private static final long serialVersionUID = 241190986363884784L; - protected T getOneByName(final String name, final Collection items) { + protected T getOneByName(final String name, final Collection items) { final List result = getAllByName(name, items); return result.isEmpty() ? null : result.get(0); } - protected List getAllByName(final String name, final Collection items) { + protected List getAllByName(final String name, final Collection items) { final List result = new ArrayList(); for (T type : items) { if (name.equals(type.getName())) { diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java new file mode 100644 index 000000000..802cef894 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java @@ -0,0 +1,117 @@ +/* + * 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.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public abstract class CsdlAbstractEdmProvider implements CsdlEdmProvider { + + @Override + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + return null; + } + + @Override + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { + return null; + } + + @Override + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + return null; + } + + @Override + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + return null; + } + + @Override + public List getActions(final FullQualifiedName actionName) throws ODataException { + return null; + } + + @Override + public List getFunctions(final FullQualifiedName functionName) throws ODataException { + return null; + } + + @Override + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException { + return null; + } + + @Override + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + throws ODataException { + return null; + } + + @Override + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + throws ODataException { + return null; + } + + @Override + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + throws ODataException { + return null; + } + + @Override + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + throws ODataException { + return null; + } + + @Override + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException { + return null; + } + + @Override + public List getAliasInfos() throws ODataException { + return null; + } + + @Override + public List getSchemas() throws ODataException { + return null; + } + + @Override + public CsdlEntityContainer getEntityContainer() throws ODataException { + return null; + } + + @Override + public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { + return null; + } + + @Override + public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { + return null; + } +} diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java similarity index 78% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java index 1a614a7f7..bfd0d8372 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java @@ -20,36 +20,36 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.List; -public class Action extends Operation { +public class CsdlAction extends CsdlOperation { private static final long serialVersionUID = 211295197043448841L; @Override - public Action setName(final String name) { + public CsdlAction setName(final String name) { this.name = name; return this; } @Override - public Action setBound(final boolean isBound) { + public CsdlAction setBound(final boolean isBound) { this.isBound = isBound; return this; } @Override - public Action setEntitySetPath(final String entitySetPath) { + public CsdlAction setEntitySetPath(final String entitySetPath) { this.entitySetPath = entitySetPath; return this; } @Override - public Action setParameters(final List parameters) { + public CsdlAction setParameters(final List parameters) { this.parameters = parameters; return this; } @Override - public Action setReturnType(final ReturnType returnType) { + public CsdlAction setReturnType(final CsdlReturnType returnType) { this.returnType = returnType; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java similarity index 82% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java index a7730394a..eb47c5c58 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java @@ -21,20 +21,20 @@ package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class ActionImport extends OperationImport { +public class CsdlActionImport extends CsdlOperationImport { private static final long serialVersionUID = 9186148718228340987L; private FullQualifiedName action; @Override - public ActionImport setName(final String name) { + public CsdlActionImport setName(final String name) { this.name = name; return this; } @Override - public ActionImport setEntitySet(final String entitySet) { + public CsdlActionImport setEntitySet(final String entitySet) { this.entitySet = entitySet; return this; } @@ -47,12 +47,12 @@ public class ActionImport extends OperationImport { return action; } - public ActionImport setAction(final String action) { + public CsdlActionImport setAction(final String action) { this.action = new FullQualifiedName(action); return this; } - public ActionImport setAction(final FullQualifiedName action) { + public CsdlActionImport setAction(final FullQualifiedName action) { this.action = action; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java similarity index 88% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java index b4493f504..ba6067aa0 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.commons.api.edm.provider; -public class AliasInfo { +public class CsdlAliasInfo { private String namespace; @@ -28,7 +28,7 @@ public class AliasInfo { return namespace; } - public AliasInfo setNamespace(final String namespace) { + public CsdlAliasInfo setNamespace(final String namespace) { this.namespace = namespace; return this; } @@ -37,7 +37,7 @@ public class AliasInfo { return alias; } - public AliasInfo setAlias(final String alias) { + public CsdlAliasInfo setAlias(final String alias) { this.alias = alias; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.java similarity index 92% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.java index 1e97719a1..393f353c7 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.java @@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.List; -public interface Annotatable { +public interface CsdlAnnotatable { - List getAnnotations(); + List getAnnotations(); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java similarity index 81% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java index 67791c9c9..580c03ffb 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; -public class Annotation extends AbstractEdmItem implements Annotatable { +public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatable { private static final long serialVersionUID = -7137313445729486860L; @@ -31,7 +31,7 @@ public class Annotation extends AbstractEdmItem implements Annotatable { private String qualifier; - private List annotation = new ArrayList(); + private List annotation = new ArrayList(); private AnnotationExpression annotationExpression; @@ -47,7 +47,7 @@ public class Annotation extends AbstractEdmItem implements Annotatable { return term; } - public Annotation setTerm(final String term) { + public CsdlAnnotation setTerm(final String term) { this.term = term; return this; } @@ -56,7 +56,7 @@ public class Annotation extends AbstractEdmItem implements Annotatable { return qualifier; } - public Annotation setQualifier(final String qualifier) { + public CsdlAnnotation setQualifier(final String qualifier) { this.qualifier = qualifier; return this; } @@ -65,13 +65,13 @@ public class Annotation extends AbstractEdmItem implements Annotatable { // return annotation; // } - public Annotation setAnnotations(final List annotation) { + public CsdlAnnotation setAnnotations(final List annotation) { this.annotation = annotation; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotation; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java similarity index 74% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java index c01566d78..595eb9605 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java @@ -21,11 +21,11 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.ArrayList; import java.util.List; -public class Annotations extends AbstractEdmItem implements Annotatable{ +public class CsdlAnnotations extends CsdlAbstractEdmItem implements CsdlAnnotatable { private static final long serialVersionUID = 8283036066408166150L; - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); private String target; @@ -35,7 +35,7 @@ public class Annotations extends AbstractEdmItem implements Annotatable{ return target; } - public Annotations setTarget(final String target) { + public CsdlAnnotations setTarget(final String target) { this.target = target; return this; } @@ -44,19 +44,19 @@ public class Annotations extends AbstractEdmItem implements Annotatable{ return qualifier; } - public Annotations setQualifier(final String qualifier) { + public CsdlAnnotations setQualifier(final String qualifier) { this.qualifier = qualifier; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public Annotation getAnnotation(final String term) { - Annotation result = null; - for (Annotation annotation : getAnnotations()) { + public CsdlAnnotation getAnnotation(final String term) { + CsdlAnnotation result = null; + for (CsdlAnnotation annotation : getAnnotations()) { if (term.equals(annotation.getTerm())) { result = annotation; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java similarity index 67% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java index 4612857ae..c7143c7ed 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public abstract class BindingTarget extends AbstractEdmItem implements Named, Annotatable { +public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -7011724617956042182L; @@ -31,15 +31,16 @@ public abstract class BindingTarget extends AbstractEdmItem implements Named, An protected FullQualifiedName type; - protected List navigationPropertyBindings = new ArrayList(); + protected List navigationPropertyBindings = + new ArrayList(); - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); public String getName() { return name; } - public BindingTarget setName(final String name) { + public CsdlBindingTarget setName(final String name) { this.name = name; return this; } @@ -52,27 +53,28 @@ public abstract class BindingTarget extends AbstractEdmItem implements Named, An return type; } - public BindingTarget setType(final String type) { + public CsdlBindingTarget setType(final String type) { this.type = new FullQualifiedName(type); return this; } - public BindingTarget setType(final FullQualifiedName type) { + public CsdlBindingTarget setType(final FullQualifiedName type) { this.type = type; return this; } - public List getNavigationPropertyBindings() { + public List getNavigationPropertyBindings() { return navigationPropertyBindings; } - public BindingTarget setNavigationPropertyBindings(final List navigationPropertyBindings) { + public CsdlBindingTarget setNavigationPropertyBindings( + final List navigationPropertyBindings) { this.navigationPropertyBindings = navigationPropertyBindings; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java similarity index 72% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java index 07f4d3ba9..208d37784 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java @@ -22,48 +22,48 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class ComplexType extends StructuralType { +public class CsdlComplexType extends CsdlStructuralType { private static final long serialVersionUID = 1089771609327713928L; @Override - public ComplexType setName(final String name) { + public CsdlComplexType setName(final String name) { this.name = name; return this; } @Override - public ComplexType setOpenType(final boolean isOpenType) { + public CsdlComplexType setOpenType(final boolean isOpenType) { this.isOpenType = isOpenType; return this; } @Override - public ComplexType setBaseType(final String baseType) { + public CsdlComplexType setBaseType(final String baseType) { this.baseType = new FullQualifiedName(baseType); return this; } @Override - public ComplexType setBaseType(final FullQualifiedName baseType) { + public CsdlComplexType setBaseType(final FullQualifiedName baseType) { this.baseType = baseType; return this; } @Override - public ComplexType setAbstract(final boolean isAbstract) { + public CsdlComplexType setAbstract(final boolean isAbstract) { this.isAbstract = isAbstract; return this; } @Override - public ComplexType setProperties(final List properties) { + public CsdlComplexType setProperties(final List properties) { this.properties = properties; return this; } @Override - public ComplexType setNavigationProperties(final List navigationProperties) { + public CsdlComplexType setNavigationProperties(final List navigationProperties) { this.navigationProperties = navigationProperties; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java new file mode 100644 index 000000000..db40de19f --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java @@ -0,0 +1,179 @@ +/* + * 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.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public interface CsdlEdmProvider { + + /** + * This method should return an {@link CsdlEnumType} or null if nothing is found + * + * @param enumTypeName + * @return {@link CsdlEnumType} for given name + * @throws ODataException + */ + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException; + + /** + * This method should return an {@link CsdlTypeDefinition} or null if nothing is found + * + * @param typeDefinitionName + * @return {@link CsdlTypeDefinition} for given name + * @throws ODataException + */ + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException; + + /** + * This method should return an {@link CsdlEntityType} or null if nothing is found + * + * @param entityTypeName + * @return {@link CsdlEntityType} for the given name + * @throws ODataException + */ + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException; + + /** + * This method should return a {@link CsdlComplexType} or null if nothing is found. + * + * @param complexTypeName + * @return {@link CsdlComplexType} for the given name + * @throws ODataException + */ + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException; + + /** + * This method should return a list of all {@link CsdlAction} for the FullQualifiedname + * or null if nothing is found + * + * @param actionName + * @return List of {@link CsdlAction} or null + * @throws ODataException + */ + public List getActions(final FullQualifiedName actionName) throws ODataException; + + /** + * This method should return a list of all {@link CsdlFunction} for the FullQualifiedname or null if nothing is + * found + * + * @param functionName + * @return List of {@link CsdlFunction} or null + * @throws ODataException + */ + public List getFunctions(final FullQualifiedName functionName) throws ODataException; + + /** + * This method should return a {@link CsdlTerm} for the FullQualifiedName or null if nothing is found. + * @param termName the name of the Term + * @return {@link CsdlTerm} or null + * @throws ODataException + */ + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException; + + /** + * This method should return an {@link CsdlEntitySet} or null if nothing is found + * + * @param entityContainer this EntitySet is contained in + * @param entitySetName + * @return {@link CsdlEntitySet} for the given container and entityset name + * @throws ODataException + */ + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + throws ODataException; + + /** + * This method should return an {@link CsdlSingleton} or null if nothing is found + * + * @param entityContainer this Singleton is contained in + * @param singletonName + * @return {@link CsdlSingleton} for given container and singleton name + * @throws ODataException + */ + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + throws ODataException; + + /** + * This method should return an {@link CsdlActionImport} or null if nothing is found + * + * @param entityContainer this ActionImport is contained in + * @param actionImportName + * @return {@link CsdlActionImport} for the given container and ActionImport name + * @throws ODataException + */ + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + throws ODataException; + + /** + * This method should return a {@link CsdlFunctionImport} or null if nothing is found + * + * @param entityContainer this FunctionImport is contained in + * @param functionImportName + * @return {@link CsdlFunctionImport} for the given container name and function import name + * @throws ODataException + */ + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + throws ODataException; + + /** + * This method should return an {@link CsdlEntityContainerInfo} or null if nothing is found + * + * @param entityContainerName (null for default container) + * @return {@link CsdlEntityContainerInfo} for the given name + * @throws ODataException + */ + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException; + + /** + * This method should return a list of all namespaces which have an alias + * + * @return List of alias info + * @throws ODataException + */ + public List getAliasInfos() throws ODataException; + + /** + * This method should return a collection of all {@link CsdlSchema} + * + * @return List<{@link Schema}> + * @throws ODataException + */ + public List getSchemas() throws ODataException; + + /** + * Returns the entity container of this edm + * @return {@link CsdlEntityContainer} of this edm + */ + public CsdlEntityContainer getEntityContainer() throws ODataException; + + /** + * @param targetName + * @return {@link CsdlAnnotations} group for the given Target + */ + public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException; + + /** + * @param annotatedName + * @return Annotatble element by target name + */ + public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException; +} diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java similarity index 62% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java index 802da4823..ee0a7720e 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class EntityContainer extends AbstractEdmItem implements Named, Annotatable { +public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = 5384682515007129458L; @@ -31,22 +31,22 @@ public class EntityContainer extends AbstractEdmItem implements Named, Annotatab private FullQualifiedName extendsContainer; - private List entitySets = new ArrayList(); + private List entitySets = new ArrayList(); - private List actionImports = new ArrayList(); + private List actionImports = new ArrayList(); - private List functionImports = new ArrayList(); + private List functionImports = new ArrayList(); - private List singletons = new ArrayList(); + private List singletons = new ArrayList(); - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); // Annotations public String getName() { return name; } - public EntityContainer setName(final String name) { + public CsdlEntityContainer setName(final String name) { this.name = name; return this; } @@ -62,25 +62,25 @@ public class EntityContainer extends AbstractEdmItem implements Named, Annotatab return extendsContainer; } - public EntityContainer setExtendsContainer(final String extendsContainer) { + public CsdlEntityContainer setExtendsContainer(final String extendsContainer) { this.extendsContainer = new FullQualifiedName(extendsContainer); return this; } - public List getEntitySets() { + public List getEntitySets() { return entitySets; } - public EntitySet getEntitySet(final String name) { + public CsdlEntitySet getEntitySet(final String name) { return getOneByName(name, getEntitySets()); } - public EntityContainer setEntitySets(final List entitySets) { + public CsdlEntityContainer setEntitySets(final List entitySets) { this.entitySets = entitySets; return this; } - public List getActionImports() { + public List getActionImports() { return actionImports; } @@ -90,7 +90,7 @@ public class EntityContainer extends AbstractEdmItem implements Named, Annotatab * @param name name. * @return action import. */ - public ActionImport getActionImport(final String name) { + public CsdlActionImport getActionImport(final String name) { return getOneByName(name, getActionImports()); } @@ -100,16 +100,16 @@ public class EntityContainer extends AbstractEdmItem implements Named, Annotatab * @param name name. * @return action imports. */ - public List getActionImports(final String name) { + public List getActionImports(final String name) { return getAllByName(name, getActionImports()); } - public EntityContainer setActionImports(final List actionImports) { + public CsdlEntityContainer setActionImports(final List actionImports) { this.actionImports = actionImports; return this; } - public List getFunctionImports() { + public List getFunctionImports() { return functionImports; } @@ -119,7 +119,7 @@ public class EntityContainer extends AbstractEdmItem implements Named, Annotatab * @param name name. * @return function import. */ - public FunctionImport getFunctionImport(final String name) { + public CsdlFunctionImport getFunctionImport(final String name) { return getOneByName(name, getFunctionImports()); } @@ -129,30 +129,30 @@ public class EntityContainer extends AbstractEdmItem implements Named, Annotatab * @param name name. * @return function imports. */ - public List getFunctionImports(final String name) { + public List getFunctionImports(final String name) { return getAllByName(name, getFunctionImports()); } - public EntityContainer setFunctionImports(final List functionImports) { + public CsdlEntityContainer setFunctionImports(final List functionImports) { this.functionImports = functionImports; return this; } - public List getSingletons() { + public List getSingletons() { return singletons; } - public Singleton getSingleton(final String name) { + public CsdlSingleton getSingleton(final String name) { return getOneByName(name, getSingletons()); } - public EntityContainer setSingletons(final List singletons) { + public CsdlEntityContainer setSingletons(final List singletons) { this.singletons = singletons; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainerInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.java similarity index 85% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainerInfo.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.java index 8de97def0..9445c8973 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainerInfo.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.java @@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class EntityContainerInfo { +public class CsdlEntityContainerInfo { private FullQualifiedName containerName; @@ -30,7 +30,7 @@ public class EntityContainerInfo { return containerName; } - public EntityContainerInfo setContainerName(final FullQualifiedName containerName) { + public CsdlEntityContainerInfo setContainerName(final FullQualifiedName containerName) { this.containerName = containerName; return this; } @@ -39,7 +39,7 @@ public class EntityContainerInfo { return extendsContainer; } - public EntityContainerInfo setExtendsContainer(final FullQualifiedName extendsContainer) { + public CsdlEntityContainerInfo setExtendsContainer(final FullQualifiedName extendsContainer) { this.extendsContainer = extendsContainer; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java similarity index 77% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySet.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java index 51d28dbd2..d4a600204 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySet.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java @@ -22,7 +22,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class EntitySet extends BindingTarget { +public class CsdlEntitySet extends CsdlBindingTarget { private static final long serialVersionUID = 5291570018480936643L; @@ -30,25 +30,26 @@ public class EntitySet extends BindingTarget { private boolean includeInServiceDocument = true; @Override - public EntitySet setName(final String name) { + public CsdlEntitySet setName(final String name) { this.name = name; return this; } @Override - public EntitySet setNavigationPropertyBindings(final List navigationPropertyBindings) { + public CsdlEntitySet setNavigationPropertyBindings( + final List navigationPropertyBindings) { this.navigationPropertyBindings = navigationPropertyBindings; return this; } @Override - public EntitySet setType(final String type) { + public CsdlEntitySet setType(final String type) { this.type = new FullQualifiedName(type); return this; } @Override - public EntitySet setType(final FullQualifiedName type) { + public CsdlEntitySet setType(final FullQualifiedName type) { this.type = type; return this; } @@ -57,7 +58,7 @@ public class EntitySet extends BindingTarget { return includeInServiceDocument; } - public EntitySet setIncludeInServiceDocument(final boolean includeInServiceDocument) { + public CsdlEntitySet setIncludeInServiceDocument(final boolean includeInServiceDocument) { this.includeInServiceDocument = includeInServiceDocument; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySetPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java similarity index 87% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySetPath.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java index 3bc8d4587..073559e9d 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySetPath.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.commons.api.edm.provider; -public class EntitySetPath { +public class CsdlEntitySetPath { private String bindingParameter; @@ -28,7 +28,7 @@ public class EntitySetPath { return bindingParameter; } - public EntitySetPath setBindingParameter(final String bindingParameter) { + public CsdlEntitySetPath setBindingParameter(final String bindingParameter) { this.bindingParameter = bindingParameter; return this; } @@ -37,7 +37,7 @@ public class EntitySetPath { return path; } - public EntitySetPath setPath(final String path) { + public CsdlEntitySetPath setPath(final String path) { this.path = path; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java similarity index 69% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java index 9994e9e4b..fad6e7a65 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java @@ -22,11 +22,11 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class EntityType extends StructuralType { +public class CsdlEntityType extends CsdlStructuralType { private static final long serialVersionUID = -1564752618679704024L; - private List key; + private List key; private boolean hasStream = false; @@ -34,58 +34,58 @@ public class EntityType extends StructuralType { return hasStream; } - public EntityType setHasStream(final boolean hasStream) { + public CsdlEntityType setHasStream(final boolean hasStream) { this.hasStream = hasStream; return this; } - public List getKey() { + public List getKey() { return key; } - public EntityType setKey(final List key) { + public CsdlEntityType setKey(final List key) { this.key = key; return this; } @Override - public EntityType setName(final String name) { + public CsdlEntityType setName(final String name) { this.name = name; return this; } @Override - public EntityType setOpenType(final boolean isOpenType) { + public CsdlEntityType setOpenType(final boolean isOpenType) { this.isOpenType = isOpenType; return this; } @Override - public EntityType setBaseType(final String baseType) { + public CsdlEntityType setBaseType(final String baseType) { this.baseType = new FullQualifiedName(baseType); return this; } @Override - public EntityType setBaseType(final FullQualifiedName baseType) { + public CsdlEntityType setBaseType(final FullQualifiedName baseType) { this.baseType = baseType; return this; } @Override - public EntityType setAbstract(final boolean isAbstract) { + public CsdlEntityType setAbstract(final boolean isAbstract) { this.isAbstract = isAbstract; return this; } @Override - public EntityType setProperties(final List properties) { + public CsdlEntityType setProperties(final List properties) { this.properties = properties; return this; } @Override - public EntityType setNavigationProperties(final List navigationProperties) { + public CsdlEntityType setNavigationProperties(final List navigationProperties) { this.navigationProperties = navigationProperties; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumMember.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java similarity index 79% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumMember.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java index 2787e3f1d..8f11bf01c 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumMember.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java @@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.ArrayList; import java.util.List; -public class EnumMember extends AbstractEdmItem implements Named, Annotatable{ +public class CsdlEnumMember extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = 5618984420582832094L; @@ -29,13 +29,13 @@ public class EnumMember extends AbstractEdmItem implements Named, Annotatable{ private String value; - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); public String getName() { return name; } - public EnumMember setName(final String name) { + public CsdlEnumMember setName(final String name) { this.name = name; return this; } @@ -44,13 +44,13 @@ public class EnumMember extends AbstractEdmItem implements Named, Annotatable{ return value; } - public EnumMember setValue(final String value) { + public CsdlEnumMember setValue(final String value) { this.value = value; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java similarity index 68% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java index badf0ba41..314ac0488 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class EnumType extends AbstractEdmItem implements Named, Annotatable { +public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -718032622783883403L; @@ -33,15 +33,15 @@ public class EnumType extends AbstractEdmItem implements Named, Annotatable { private FullQualifiedName underlyingType; - private List members = new ArrayList(); + private List members = new ArrayList(); - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); public String getName() { return name; } - public EnumType setName(final String name) { + public CsdlEnumType setName(final String name) { this.name = name; return this; } @@ -50,7 +50,7 @@ public class EnumType extends AbstractEdmItem implements Named, Annotatable { return isFlags; } - public EnumType setFlags(final boolean isFlags) { + public CsdlEnumType setFlags(final boolean isFlags) { this.isFlags = isFlags; return this; } @@ -62,25 +62,25 @@ public class EnumType extends AbstractEdmItem implements Named, Annotatable { return null; } - public EnumType setUnderlyingType(final String underlyingType) { + public CsdlEnumType setUnderlyingType(final String underlyingType) { this.underlyingType = new FullQualifiedName(underlyingType); return this; } - public EnumType setUnderlyingType(final FullQualifiedName underlyingType) { + public CsdlEnumType setUnderlyingType(final FullQualifiedName underlyingType) { this.underlyingType = underlyingType; return this; } - public List getMembers() { + public List getMembers() { return members; } - public EnumMember getMember(final String name) { - EnumMember result = null; + public CsdlEnumMember getMember(final String name) { + CsdlEnumMember result = null; if (getMembers() != null) { - for (EnumMember member : getMembers()) { + for (CsdlEnumMember member : getMembers()) { if (name.equals(member.getName())) { result = member; } @@ -89,10 +89,10 @@ public class EnumType extends AbstractEdmItem implements Named, Annotatable { return result; } - public EnumMember getMember(final Integer value) { - EnumMember result = null; + public CsdlEnumMember getMember(final Integer value) { + CsdlEnumMember result = null; if (getMembers() != null) { - for (EnumMember member : getMembers()) { + for (CsdlEnumMember member : getMembers()) { if (String.valueOf(value).equals(member.getValue())) { result = member; } @@ -101,13 +101,13 @@ public class EnumType extends AbstractEdmItem implements Named, Annotatable { return result; } - public EnumType setMembers(final List members) { + public CsdlEnumType setMembers(final List members) { this.members = members; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java similarity index 96% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java index 1784dadcc..cb3f76522 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java @@ -18,6 +18,6 @@ */ package org.apache.olingo.commons.api.edm.provider; -public class Expression { +public class CsdlExpression { //TODO: Expression implementation } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java similarity index 76% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java index 04f052144..38b32c75a 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java @@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.List; -public class Function extends Operation { +public class CsdlFunction extends CsdlOperation { private static final long serialVersionUID = 673858921468578957L; @@ -30,37 +30,37 @@ public class Function extends Operation { return isComposable; } - public Function setComposable(final boolean isComposable) { + public CsdlFunction setComposable(final boolean isComposable) { this.isComposable = isComposable; return this; } @Override - public Function setName(final String name) { + public CsdlFunction setName(final String name) { this.name = name; return this; } @Override - public Function setBound(final boolean isBound) { + public CsdlFunction setBound(final boolean isBound) { this.isBound = isBound; return this; } @Override - public Function setEntitySetPath(final String entitySetPath) { + public CsdlFunction setEntitySetPath(final String entitySetPath) { this.entitySetPath = entitySetPath; return this; } @Override - public Function setParameters(final List parameters) { + public CsdlFunction setParameters(final List parameters) { this.parameters = parameters; return this; } @Override - public Function setReturnType(final ReturnType returnType) { + public CsdlFunction setReturnType(final CsdlReturnType returnType) { this.returnType = returnType; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java similarity index 80% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java index 84d678912..ed14759d9 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java @@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class FunctionImport extends OperationImport { +public class CsdlFunctionImport extends CsdlOperationImport { private static final long serialVersionUID = 8479762299534736719L; @@ -36,13 +36,13 @@ public class FunctionImport extends OperationImport { } @Override - public FunctionImport setName(final String name) { + public CsdlFunctionImport setName(final String name) { this.name = name; return this; } @Override - public FunctionImport setEntitySet(final String entitySet) { + public CsdlFunctionImport setEntitySet(final String entitySet) { this.entitySet = entitySet; return this; } @@ -56,12 +56,12 @@ public class FunctionImport extends OperationImport { } - public FunctionImport setFunction(final FullQualifiedName function) { + public CsdlFunctionImport setFunction(final FullQualifiedName function) { this.function = function; return this; } - public FunctionImport setFunction(final String function) { + public CsdlFunctionImport setFunction(final String function) { this.function = new FullQualifiedName(function); return this; } @@ -70,7 +70,7 @@ public class FunctionImport extends OperationImport { return includeInServiceDocument; } - public FunctionImport setIncludeInServiceDocument(final boolean includeInServiceDocument) { + public CsdlFunctionImport setIncludeInServiceDocument(final boolean includeInServiceDocument) { this.includeInServiceDocument = includeInServiceDocument; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java similarity index 93% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java index 472a28e71..32bc7827d 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java @@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmMapping; * Content of this class does not appear within the CSDL metadata document. This class is used to perform server * internal mapping for edm primitive types to java types. */ -public class Mapping implements EdmMapping { +public class CsdlMapping implements EdmMapping { private Class mappedJavaClass; @@ -34,7 +34,7 @@ public class Mapping implements EdmMapping { * @param mappedJavaClass class to which is mapped * @return this for method chaining */ - public Mapping setMappedJavaClass(Class mappedJavaClass) { + public CsdlMapping setMappedJavaClass(Class mappedJavaClass) { this.mappedJavaClass = mappedJavaClass; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNamed.java similarity index 94% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNamed.java index 6b716a60a..24a5803f2 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNamed.java @@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.io.Serializable; -public interface Named extends Serializable { +public interface CsdlNamed extends Serializable { String getName(); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java similarity index 66% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java index bfb74b012..16fc68ef2 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class NavigationProperty extends AbstractEdmItem implements Named, Annotatable{ +public class CsdlNavigationProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -788021920718310799L; @@ -37,14 +37,14 @@ public class NavigationProperty extends AbstractEdmItem implements Named, Annota private boolean containsTarget = false; - private List referentialConstraints = new ArrayList(); + private List referentialConstraints = new ArrayList(); // Facets private boolean nullable = true; - private OnDelete onDelete; + private CsdlOnDelete onDelete; - private List annotations = new ArrayList(); + private List annotations = new ArrayList(); public String getName() { return name; @@ -54,12 +54,12 @@ public class NavigationProperty extends AbstractEdmItem implements Named, Annota return isCollection; } - public NavigationProperty setCollection(final boolean isCollection) { + public CsdlNavigationProperty setCollection(final boolean isCollection) { this.isCollection = isCollection; return this; } - public NavigationProperty setName(final String name) { + public CsdlNavigationProperty setName(final String name) { this.name = name; return this; } @@ -75,12 +75,12 @@ public class NavigationProperty extends AbstractEdmItem implements Named, Annota return null; } - public NavigationProperty setType(final FullQualifiedName type) { + public CsdlNavigationProperty setType(final FullQualifiedName type) { this.type = type; return this; } - public NavigationProperty setType(final String type) { + public CsdlNavigationProperty setType(final String type) { this.type = new FullQualifiedName(type); return this; } @@ -89,7 +89,7 @@ public class NavigationProperty extends AbstractEdmItem implements Named, Annota return partner; } - public NavigationProperty setPartner(final String partner) { + public CsdlNavigationProperty setPartner(final String partner) { this.partner = partner; return this; } @@ -98,16 +98,17 @@ public class NavigationProperty extends AbstractEdmItem implements Named, Annota return containsTarget; } - public NavigationProperty setContainsTarget(final boolean containsTarget) { + public CsdlNavigationProperty setContainsTarget(final boolean containsTarget) { this.containsTarget = containsTarget; return this; } - public List getReferentialConstraints() { + public List getReferentialConstraints() { return referentialConstraints; } - public NavigationProperty setReferentialConstraints(final List referentialConstraints) { + public CsdlNavigationProperty setReferentialConstraints( + final List referentialConstraints) { this.referentialConstraints = referentialConstraints; return this; } @@ -116,22 +117,22 @@ public class NavigationProperty extends AbstractEdmItem implements Named, Annota return nullable; } - public NavigationProperty setNullable(final Boolean nullable) { + public CsdlNavigationProperty setNullable(final Boolean nullable) { this.nullable = nullable; return this; } - public OnDelete getOnDelete() { + public CsdlOnDelete getOnDelete() { return onDelete; } - public NavigationProperty setOnDelete(final OnDelete onDelete) { + public CsdlNavigationProperty setOnDelete(final CsdlOnDelete onDelete) { this.onDelete = onDelete; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java similarity index 84% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java index 1ac7d6bba..ce14ead3b 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java @@ -19,7 +19,7 @@ package org.apache.olingo.commons.api.edm.provider; -public class NavigationPropertyBinding extends AbstractEdmItem { +public class CsdlNavigationPropertyBinding extends CsdlAbstractEdmItem { private static final long serialVersionUID = 770380971233808502L; @@ -31,7 +31,7 @@ public class NavigationPropertyBinding extends AbstractEdmItem { return path; } - public NavigationPropertyBinding setPath(final String path) { + public CsdlNavigationPropertyBinding setPath(final String path) { this.path = path; return this; } @@ -40,7 +40,7 @@ public class NavigationPropertyBinding extends AbstractEdmItem { return target; } - public NavigationPropertyBinding setTarget(final String target) { + public CsdlNavigationPropertyBinding setTarget(final String target) { this.target = target; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java similarity index 81% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java index e699dbb12..1b03ba82a 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java @@ -20,17 +20,17 @@ package org.apache.olingo.commons.api.edm.provider; -public class OnDelete extends AbstractEdmItem { +public class CsdlOnDelete extends CsdlAbstractEdmItem { private static final long serialVersionUID = -7130889202653716784L; - private OnDeleteAction action = OnDeleteAction.None; + private CsdlOnDeleteAction action = CsdlOnDeleteAction.None; - public OnDeleteAction getAction() { + public CsdlOnDeleteAction getAction() { return action; } - public OnDelete setAction(final OnDeleteAction action) { + public CsdlOnDelete setAction(final CsdlOnDeleteAction action) { this.action = action; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDeleteAction.java similarity index 96% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDeleteAction.java index a5bf50b3a..822f0ce5a 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDeleteAction.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.commons.api.edm.provider; -public enum OnDeleteAction { +public enum CsdlOnDeleteAction { Cascade, None, diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java similarity index 66% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java index 882087c71..e7cd6afd7 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java @@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.ArrayList; import java.util.List; -public abstract class Operation extends AbstractEdmItem implements Named, Annotatable{ +public abstract class CsdlOperation extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -3842411084067064086L; @@ -31,17 +31,17 @@ public abstract class Operation extends AbstractEdmItem implements Named, Annota protected String entitySetPath; - protected List parameters = new ArrayList(); + protected List parameters = new ArrayList(); - protected ReturnType returnType; + protected CsdlReturnType returnType; - protected final List annotations = new ArrayList(); + protected final List annotations = new ArrayList(); public String getName() { return name; } - public Operation setName(final String name) { + public CsdlOperation setName(final String name) { this.name = name; return this; } @@ -50,7 +50,7 @@ public abstract class Operation extends AbstractEdmItem implements Named, Annota return isBound; } - public Operation setBound(final boolean isBound) { + public CsdlOperation setBound(final boolean isBound) { this.isBound = isBound; return this; } @@ -59,34 +59,34 @@ public abstract class Operation extends AbstractEdmItem implements Named, Annota return entitySetPath; } - public Operation setEntitySetPath(final String entitySetPath) { + public CsdlOperation setEntitySetPath(final String entitySetPath) { this.entitySetPath = entitySetPath; return this; } - public List getParameters() { + public List getParameters() { return parameters; } - public Parameter getParameter(String name) { + public CsdlParameter getParameter(String name) { return getOneByName(name, getParameters()); } - public Operation setParameters(final List parameters) { + public CsdlOperation setParameters(final List parameters) { this.parameters = parameters; return this; } - public ReturnType getReturnType() { + public CsdlReturnType getReturnType() { return returnType; } - public Operation setReturnType(final ReturnType returnType) { + public CsdlOperation setReturnType(final CsdlReturnType returnType) { this.returnType = returnType; return this; } - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java similarity index 77% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java index 7de962365..af214719e 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java @@ -21,19 +21,19 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.ArrayList; import java.util.List; -public abstract class OperationImport extends AbstractEdmItem implements Named, Annotatable{ +public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -8928186067970681061L; protected String name; protected String entitySet; - protected final List annotations = new ArrayList(); + protected final List annotations = new ArrayList(); public String getName() { return name; } - public OperationImport setName(final String name) { + public CsdlOperationImport setName(final String name) { this.name = name; return this; } @@ -42,13 +42,13 @@ public abstract class OperationImport extends AbstractEdmItem implements Named, return entitySet; } - public OperationImport setEntitySet(final String entitySet) { + public CsdlOperationImport setEntitySet(final String entitySet) { this.entitySet = entitySet; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java similarity index 73% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java index fb29da272..15c2c3a97 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; -public class Parameter extends AbstractEdmItem implements Named, Annotatable{ +public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -7360900923880732015L; @@ -34,7 +34,7 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ private boolean isCollection; - private Mapping mapping; + private CsdlMapping mapping; // Facets private boolean nullable = true; @@ -47,13 +47,13 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ private SRID srid; - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); public String getName() { return name; } - public Parameter setName(final String name) { + public CsdlParameter setName(final String name) { this.name = name; return this; } @@ -66,12 +66,12 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return type; } - public Parameter setType(final String type) { + public CsdlParameter setType(final String type) { this.type = new FullQualifiedName(type); return this; } - public Parameter setType(final FullQualifiedName type) { + public CsdlParameter setType(final FullQualifiedName type) { this.type = type; return this; } @@ -80,7 +80,7 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return isCollection; } - public Parameter setCollection(final boolean isCollection) { + public CsdlParameter setCollection(final boolean isCollection) { this.isCollection = isCollection; return this; } @@ -89,7 +89,7 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return nullable; } - public Parameter setNullable(final boolean nullable) { + public CsdlParameter setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -98,7 +98,7 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return maxLength; } - public Parameter setMaxLength(final Integer maxLength) { + public CsdlParameter setMaxLength(final Integer maxLength) { this.maxLength = maxLength; return this; } @@ -107,7 +107,7 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return precision; } - public Parameter setPrecision(final Integer precision) { + public CsdlParameter setPrecision(final Integer precision) { this.precision = precision; return this; } @@ -116,7 +116,7 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return scale; } - public Parameter setScale(final Integer scale) { + public CsdlParameter setScale(final Integer scale) { this.scale = scale; return this; } @@ -125,21 +125,21 @@ public class Parameter extends AbstractEdmItem implements Named, Annotatable{ return srid; } - public Parameter setSrid(final SRID srid) { + public CsdlParameter setSrid(final SRID srid) { this.srid = srid; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public Mapping getMapping() { + public CsdlMapping getMapping() { return mapping; } - public Parameter setMapping(final Mapping mapping) { + public CsdlParameter setMapping(final CsdlMapping mapping) { this.mapping = mapping; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java similarity index 73% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java index cf4e928ff..42f7b654a 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; -public class Property extends AbstractEdmItem implements Named, Annotatable{ +public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = -4224390853690843450L; @@ -36,7 +36,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ private String mimeType; - private Mapping mapping; + private CsdlMapping mapping; // Facets private String defaultValue; @@ -53,14 +53,14 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ private SRID srid; - private List annotations = new ArrayList(); + private List annotations = new ArrayList(); public String getName() { return name; } - public Property setName(final String name) { + public CsdlProperty setName(final String name) { this.name = name; return this; } @@ -69,7 +69,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return type; } - public Property setType(final String type) { + public CsdlProperty setType(final String type) { this.type = type; return this; } @@ -78,7 +78,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return new FullQualifiedName(type); } - public Property setType(FullQualifiedName fqnName){ + public CsdlProperty setType(FullQualifiedName fqnName){ this.type = fqnName.getFullQualifiedNameAsString(); return this; } @@ -87,7 +87,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return collection; } - public Property setCollection(final boolean isCollection) { + public CsdlProperty setCollection(final boolean isCollection) { collection = isCollection; return this; } @@ -96,7 +96,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return defaultValue; } - public Property setDefaultValue(final String defaultValue) { + public CsdlProperty setDefaultValue(final String defaultValue) { this.defaultValue = defaultValue; return this; } @@ -105,7 +105,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return nullable; } - public Property setNullable(final boolean nullable) { + public CsdlProperty setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -114,7 +114,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return maxLength; } - public Property setMaxLength(final Integer maxLength) { + public CsdlProperty setMaxLength(final Integer maxLength) { this.maxLength = maxLength; return this; } @@ -123,7 +123,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return precision; } - public Property setPrecision(final Integer precision) { + public CsdlProperty setPrecision(final Integer precision) { this.precision = precision; return this; } @@ -132,7 +132,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return scale; } - public Property setScale(final Integer scale) { + public CsdlProperty setScale(final Integer scale) { this.scale = scale; return this; } @@ -141,7 +141,7 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return unicode; } - public Property setUnicode(final boolean unicode) { + public CsdlProperty setUnicode(final boolean unicode) { this.unicode = unicode; return this; } @@ -150,26 +150,26 @@ public class Property extends AbstractEdmItem implements Named, Annotatable{ return mimeType; } - public Property setMimeType(final String mimeType) { + public CsdlProperty setMimeType(final String mimeType) { this.mimeType = mimeType; return this; } - public Mapping getMapping() { + public CsdlMapping getMapping() { return mapping; } - public Property setMapping(final Mapping mapping) { + public CsdlProperty setMapping(final CsdlMapping mapping) { this.mapping = mapping; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public Property setSrid(final SRID srid) { + public CsdlProperty setSrid(final SRID srid) { this.srid = srid; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java similarity index 86% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java index 6588aaa89..a57ce4ea5 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.commons.api.edm.provider; -public class PropertyRef extends AbstractEdmItem implements Named{ +public class CsdlPropertyRef extends CsdlAbstractEdmItem implements CsdlNamed { private static final long serialVersionUID = 9082892362895660037L; @@ -30,7 +30,7 @@ public class PropertyRef extends AbstractEdmItem implements Named{ return name; } - public PropertyRef setName(final String name) { + public CsdlPropertyRef setName(final String name) { this.name = name; return this; } @@ -39,7 +39,7 @@ public class PropertyRef extends AbstractEdmItem implements Named{ return alias; } - public PropertyRef setAlias(final String alias) { + public CsdlPropertyRef setAlias(final String alias) { this.alias = alias; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java similarity index 77% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java index 72c84c168..7c06724d6 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java @@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.ArrayList; import java.util.List; -public class ReferentialConstraint extends AbstractEdmItem implements Annotatable { +public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements CsdlAnnotatable { private static final long serialVersionUID = -7467707499798840075L; @@ -29,13 +29,13 @@ public class ReferentialConstraint extends AbstractEdmItem implements Annotatabl private String referencedProperty; - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); public String getProperty() { return property; } - public ReferentialConstraint setProperty(final String property) { + public CsdlReferentialConstraint setProperty(final String property) { this.property = property; return this; } @@ -44,13 +44,13 @@ public class ReferentialConstraint extends AbstractEdmItem implements Annotatabl return referencedProperty; } - public ReferentialConstraint setReferencedProperty(final String referencedProperty) { + public CsdlReferentialConstraint setReferencedProperty(final String referencedProperty) { this.referencedProperty = referencedProperty; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java similarity index 80% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java index 1d58ae1c0..f0d5e9eed 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java @@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; -public class ReturnType extends AbstractEdmItem{ +public class CsdlReturnType extends CsdlAbstractEdmItem { private static final long serialVersionUID = 4816954124986010965L; @@ -48,12 +48,12 @@ public class ReturnType extends AbstractEdmItem{ return type; } - public ReturnType setType(final String type) { + public CsdlReturnType setType(final String type) { this.type = new FullQualifiedName(type); return this; } - public ReturnType setType(final FullQualifiedName type) { + public CsdlReturnType setType(final FullQualifiedName type) { this.type = type; return this; } @@ -62,7 +62,7 @@ public class ReturnType extends AbstractEdmItem{ return isCollection; } - public ReturnType setCollection(final boolean isCollection) { + public CsdlReturnType setCollection(final boolean isCollection) { this.isCollection = isCollection; return this; } @@ -71,7 +71,7 @@ public class ReturnType extends AbstractEdmItem{ return nullable; } - public ReturnType setNullable(final boolean nullable) { + public CsdlReturnType setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -80,7 +80,7 @@ public class ReturnType extends AbstractEdmItem{ return maxLength; } - public ReturnType setMaxLength(final Integer maxLength) { + public CsdlReturnType setMaxLength(final Integer maxLength) { this.maxLength = maxLength; return this; } @@ -89,7 +89,7 @@ public class ReturnType extends AbstractEdmItem{ return precision; } - public ReturnType setPrecision(final Integer precision) { + public CsdlReturnType setPrecision(final Integer precision) { this.precision = precision; return this; } @@ -98,7 +98,7 @@ public class ReturnType extends AbstractEdmItem{ return scale; } - public ReturnType setScale(final Integer scale) { + public CsdlReturnType setScale(final Integer scale) { this.scale = scale; return this; } @@ -107,7 +107,7 @@ public class ReturnType extends AbstractEdmItem{ return srid; } - public ReturnType setSrid(final SRID srid) { + public CsdlReturnType setSrid(final SRID srid) { this.srid = srid; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java similarity index 51% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java index 7ed27041e..8300eaa1f 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class Schema extends AbstractEdmItem implements Annotatable{ +public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable { private static final long serialVersionUID = -1527213201328056750L; @@ -31,34 +31,34 @@ public class Schema extends AbstractEdmItem implements Annotatable{ private String alias; - private List enumTypes = new ArrayList(); + private List enumTypes = new ArrayList(); - private List typeDefinitions = new ArrayList(); + private List typeDefinitions = new ArrayList(); - private List entityTypes = new ArrayList(); + private List entityTypes = new ArrayList(); - private List complexTypes = new ArrayList(); + private List complexTypes = new ArrayList(); - private List actions = new ArrayList(); + private List actions = new ArrayList(); - private List functions = new ArrayList(); + private List functions = new ArrayList(); - private EntityContainer entityContainer; + private CsdlEntityContainer entityContainer; - private List terms = new ArrayList(); + private List terms = new ArrayList(); - private final List annotationGroups = new ArrayList(); + private final List annotationGroups = new ArrayList(); - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); - private Map annotatables; + private Map annotatables; public String getNamespace() { return namespace; } - public Schema setNamespace(final String namespace) { + public CsdlSchema setNamespace(final String namespace) { this.namespace = namespace; return this; } @@ -67,64 +67,64 @@ public class Schema extends AbstractEdmItem implements Annotatable{ return alias; } - public Schema setAlias(final String alias) { + public CsdlSchema setAlias(final String alias) { this.alias = alias; return this; } - public List getEnumTypes() { + public List getEnumTypes() { return enumTypes; } - public EnumType getEnumType(final String name) { + public CsdlEnumType getEnumType(final String name) { return getOneByName(name, getEnumTypes()); } - public Schema setEnumTypes(final List enumTypes) { + public CsdlSchema setEnumTypes(final List enumTypes) { this.enumTypes = enumTypes; return this; } - public List getTypeDefinitions() { + public List getTypeDefinitions() { return typeDefinitions; } - public TypeDefinition getTypeDefinition(final String name) { + public CsdlTypeDefinition getTypeDefinition(final String name) { return getOneByName(name, getTypeDefinitions()); } - public Schema setTypeDefinitions(final List typeDefinitions) { + public CsdlSchema setTypeDefinitions(final List typeDefinitions) { this.typeDefinitions = typeDefinitions; return this; } - public List getEntityTypes() { + public List getEntityTypes() { return entityTypes; } - public EntityType getEntityType(final String name) { + public CsdlEntityType getEntityType(final String name) { return getOneByName(name, getEntityTypes()); } - public Schema setEntityTypes(final List entityTypes) { + public CsdlSchema setEntityTypes(final List entityTypes) { this.entityTypes = entityTypes; return this; } - public List getComplexTypes() { + public List getComplexTypes() { return complexTypes; } - public ComplexType getComplexType(final String name) { + public CsdlComplexType getComplexType(final String name) { return getOneByName(name, getComplexTypes()); } - public Schema setComplexTypes(final List complexTypes) { + public CsdlSchema setComplexTypes(final List complexTypes) { this.complexTypes = complexTypes; return this; } - public List getActions() { + public List getActions() { return actions; } @@ -133,16 +133,16 @@ public class Schema extends AbstractEdmItem implements Annotatable{ * @param name * @return a list of actions */ - public List getActions(final String name) { + public List getActions(final String name) { return getAllByName(name, getActions()); } - public Schema setActions(final List actions) { + public CsdlSchema setActions(final List actions) { this.actions = actions; return this; } - public List getFunctions() { + public List getFunctions() { return functions; } @@ -151,45 +151,45 @@ public class Schema extends AbstractEdmItem implements Annotatable{ * @param name * @return a list of functions */ - public List getFunctions(final String name) { + public List getFunctions(final String name) { return getAllByName(name, getFunctions()); } - public Schema setFunctions(final List functions) { + public CsdlSchema setFunctions(final List functions) { this.functions = functions; return this; } - public EntityContainer getEntityContainer() { + public CsdlEntityContainer getEntityContainer() { return entityContainer; } - public Schema setEntityContainer(final EntityContainer entityContainer) { + public CsdlSchema setEntityContainer(final CsdlEntityContainer entityContainer) { this.entityContainer = entityContainer; return this; } - public List getTerms() { + public List getTerms() { return terms; } - public Term getTerm(final String name) { + public CsdlTerm getTerm(final String name) { return getOneByName(name, getTerms()); } - public Schema setTerms(final List terms) { + public CsdlSchema setTerms(final List terms) { this.terms = terms; return this; } - public List getAnnotationGroups() { + public List getAnnotationGroups() { return annotationGroups; } - public Annotations getAnnotationGroup(final String target) { - Annotations result = null; - for (Annotations annots : getAnnotationGroups()) { + public CsdlAnnotations getAnnotationGroup(final String target) { + CsdlAnnotations result = null; + for (CsdlAnnotations annots : getAnnotationGroups()) { if (target.equals(annots.getTarget())) { result = annots; } @@ -197,9 +197,9 @@ public class Schema extends AbstractEdmItem implements Annotatable{ return result; } - public Annotation getAnnotation(final String term) { - Annotation result = null; - for (Annotation annot : getAnnotations()) { + public CsdlAnnotation getAnnotation(final String term) { + CsdlAnnotation result = null; + for (CsdlAnnotation annot : getAnnotations()) { if (term.equals(annot.getTerm())) { result = annot; } @@ -207,55 +207,55 @@ public class Schema extends AbstractEdmItem implements Annotatable{ return result; } - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public Map getAnnotatables() { + public Map getAnnotatables() { if (annotatables == null) { - annotatables = new HashMap(); - for (Annotations annotationGroup : getAnnotationGroups()) { + annotatables = new HashMap(); + for (CsdlAnnotations annotationGroup : getAnnotationGroups()) { annotatables.put(null, annotationGroup); } - for (Annotation annotation : getAnnotations()) { + for (CsdlAnnotation annotation : getAnnotations()) { annotatables.put(annotation.getTerm(), annotation); } - for (Action action : getActions()) { + for (CsdlAction action : getActions()) { annotatables.put(action.getName(), action); } - for (ComplexType complexType : getComplexTypes()) { + for (CsdlComplexType complexType : getComplexTypes()) { annotatables.put(complexType.getName(), complexType); } - for (EntityType entityType : getEntityTypes()) { + for (CsdlEntityType entityType : getEntityTypes()) { annotatables.put(entityType.getName(), entityType); } - for (EnumType enumType : getEnumTypes()) { + for (CsdlEnumType enumType : getEnumTypes()) { annotatables.put(enumType.getName(), enumType); } - for (Function function : getFunctions()) { + for (CsdlFunction function : getFunctions()) { annotatables.put(function.getName(), function); } - for (Term term : getTerms()) { + for (CsdlTerm term : getTerms()) { annotatables.put(term.getName(), term); } - for (TypeDefinition typedef : getTypeDefinitions()) { + for (CsdlTypeDefinition typedef : getTypeDefinitions()) { annotatables.put(typedef.getName(), typedef); } if (entityContainer != null) { annotatables.put(entityContainer.getName(), entityContainer); - for (Annotation annotation : entityContainer.getAnnotations()) { + for (CsdlAnnotation annotation : entityContainer.getAnnotations()) { annotatables.put(annotation.getTerm(), annotation); } - for (ActionImport actionImport : entityContainer.getActionImports()) { + for (CsdlActionImport actionImport : entityContainer.getActionImports()) { annotatables.put(actionImport.getName(), actionImport); } - for (FunctionImport functionImport : entityContainer.getFunctionImports()) { + for (CsdlFunctionImport functionImport : entityContainer.getFunctionImports()) { annotatables.put(functionImport.getName(), functionImport); } - for (EntitySet entitySet : entityContainer.getEntitySets()) { + for (CsdlEntitySet entitySet : entityContainer.getEntitySets()) { annotatables.put(entitySet.getName(), entitySet); } - for (Singleton singleton : entityContainer.getSingletons()) { + for (CsdlSingleton singleton : entityContainer.getSingletons()) { annotatables.put(singleton.getName(), singleton); } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java similarity index 78% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java index e2e14f4a1..c5ca25332 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java @@ -22,30 +22,31 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public class Singleton extends BindingTarget { +public class CsdlSingleton extends CsdlBindingTarget { private static final long serialVersionUID = -3997943079062565895L; @Override - public Singleton setName(final String name) { + public CsdlSingleton setName(final String name) { this.name = name; return this; } @Override - public Singleton setType(final String type) { + public CsdlSingleton setType(final String type) { this.type = new FullQualifiedName(type); return this; } @Override - public Singleton setType(final FullQualifiedName type) { + public CsdlSingleton setType(final FullQualifiedName type) { this.type = type; return this; } @Override - public Singleton setNavigationPropertyBindings(final List navigationPropertyBindings) { + public CsdlSingleton setNavigationPropertyBindings( + final List navigationPropertyBindings) { this.navigationPropertyBindings = navigationPropertyBindings; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java similarity index 65% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java index 61d70c7f3..fdadf481c 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -public abstract class StructuralType extends AbstractEdmItem implements Named, Annotatable { +public abstract class CsdlStructuralType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = 8662852373514258646L; @@ -35,17 +35,17 @@ public abstract class StructuralType extends AbstractEdmItem implements Named, A protected boolean isAbstract; - protected List properties = new ArrayList(); + protected List properties = new ArrayList(); - protected List navigationProperties = new ArrayList(); + protected List navigationProperties = new ArrayList(); - protected final List annotations = new ArrayList(); + protected final List annotations = new ArrayList(); public String getName() { return name; } - public StructuralType setName(final String name) { + public CsdlStructuralType setName(final String name) { this.name = name; return this; } @@ -54,7 +54,7 @@ public abstract class StructuralType extends AbstractEdmItem implements Named, A return isOpenType; } - public StructuralType setOpenType(final boolean isOpenType) { + public CsdlStructuralType setOpenType(final boolean isOpenType) { this.isOpenType = isOpenType; return this; } @@ -70,12 +70,12 @@ public abstract class StructuralType extends AbstractEdmItem implements Named, A return baseType; } - public StructuralType setBaseType(final String baseType) { + public CsdlStructuralType setBaseType(final String baseType) { this.baseType = new FullQualifiedName(baseType); return this; } - public StructuralType setBaseType(final FullQualifiedName baseType) { + public CsdlStructuralType setBaseType(final FullQualifiedName baseType) { this.baseType = baseType; return this; } @@ -84,39 +84,39 @@ public abstract class StructuralType extends AbstractEdmItem implements Named, A return isAbstract; } - public StructuralType setAbstract(final boolean isAbstract) { + public CsdlStructuralType setAbstract(final boolean isAbstract) { this.isAbstract = isAbstract; return this; } - public List getProperties() { + public List getProperties() { return properties; } - public Property getProperty(String name) { + public CsdlProperty getProperty(String name) { return getOneByName(name, properties); } - public StructuralType setProperties(final List properties) { + public CsdlStructuralType setProperties(final List properties) { this.properties = properties; return this; } - public List getNavigationProperties() { + public List getNavigationProperties() { return navigationProperties; } - public NavigationProperty getNavigationProperty(String name) { + public CsdlNavigationProperty getNavigationProperty(String name) { return getOneByName(name, navigationProperties); } - public StructuralType setNavigationProperties(final List navigationProperties) { + public CsdlStructuralType setNavigationProperties(final List navigationProperties) { this.navigationProperties = navigationProperties; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java similarity index 74% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java index 45b9afe2d..ace5e3696 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.geo.SRID; -public class Term extends AbstractEdmItem implements Named, Annotatable{ +public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = 3843929000407818103L; @@ -50,13 +50,13 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ private SRID srid; - private List annotations = new ArrayList(); + private List annotations = new ArrayList(); public String getName() { return name; } - public Term setName(final String name) { + public CsdlTerm setName(final String name) { this.name = name; return this; } @@ -65,7 +65,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return type; } - public Term setType(final String type) { + public CsdlTerm setType(final String type) { this.type = type; return this; } @@ -74,7 +74,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return baseTerm; } - public Term setBaseTerm(final String baseTerm) { + public CsdlTerm setBaseTerm(final String baseTerm) { this.baseTerm = baseTerm; return this; } @@ -83,7 +83,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return appliesTo; } - public Term setAppliesTo(final List appliesTo) { + public CsdlTerm setAppliesTo(final List appliesTo) { this.appliesTo = appliesTo; return this; } @@ -92,7 +92,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return isCollection; } - public Term setCollection(final boolean isCollection) { + public CsdlTerm setCollection(final boolean isCollection) { this.isCollection = isCollection; return this; } @@ -101,7 +101,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return defaultValue; } - public Term setDefaultValue(final String defaultValue) { + public CsdlTerm setDefaultValue(final String defaultValue) { this.defaultValue = defaultValue; return this; } @@ -110,7 +110,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return nullable; } - public Term setNullable(final boolean nullable) { + public CsdlTerm setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -119,7 +119,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return maxLength; } - public Term setMaxLength(final Integer maxLength) { + public CsdlTerm setMaxLength(final Integer maxLength) { this.maxLength = maxLength; return this; } @@ -128,7 +128,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return precision; } - public Term setPrecision(final Integer precision) { + public CsdlTerm setPrecision(final Integer precision) { this.precision = precision; return this; } @@ -137,16 +137,16 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return scale; } - public Term setScale(final Integer scale) { + public CsdlTerm setScale(final Integer scale) { this.scale = scale; return this; } - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public Term setAnnotations(final List annotations) { + public CsdlTerm setAnnotations(final List annotations) { this.annotations = annotations; return this; } @@ -155,7 +155,7 @@ public class Term extends AbstractEdmItem implements Named, Annotatable{ return srid; } - public Term setSrid(final SRID srid) { + public CsdlTerm setSrid(final SRID srid) { this.srid = srid; return this; } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java similarity index 74% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java index b886b1e84..705c040b3 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; -public class TypeDefinition extends AbstractEdmItem implements Named, Annotatable { +public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { private static final long serialVersionUID = 3718980071229613048L; @@ -43,13 +43,13 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl private SRID srid; - private final List annotations = new ArrayList(); + private final List annotations = new ArrayList(); public String getName() { return name; } - public TypeDefinition setName(final String name) { + public CsdlTypeDefinition setName(final String name) { this.name = name; return this; } @@ -61,12 +61,12 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl return null; } - public TypeDefinition setUnderlyingType(final String underlyingType) { + public CsdlTypeDefinition setUnderlyingType(final String underlyingType) { this.underlyingType = new FullQualifiedName(underlyingType); return this; } - public TypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) { + public CsdlTypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) { this.underlyingType = underlyingType; return this; } @@ -75,7 +75,7 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl return maxLength; } - public TypeDefinition setMaxLength(final Integer maxLength) { + public CsdlTypeDefinition setMaxLength(final Integer maxLength) { this.maxLength = maxLength; return this; } @@ -84,7 +84,7 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl return precision; } - public TypeDefinition setPrecision(final Integer precision) { + public CsdlTypeDefinition setPrecision(final Integer precision) { this.precision = precision; return this; } @@ -93,7 +93,7 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl return scale; } - public TypeDefinition setScale(final Integer scale) { + public CsdlTypeDefinition setScale(final Integer scale) { this.scale = scale; return this; } @@ -102,7 +102,7 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl return unicode; } - public TypeDefinition setUnicode(final boolean unicode) { + public CsdlTypeDefinition setUnicode(final boolean unicode) { this.unicode = unicode; return this; } @@ -111,13 +111,13 @@ public class TypeDefinition extends AbstractEdmItem implements Named, Annotatabl return srid; } - public TypeDefinition setSrid(final SRID srid) { + public CsdlTypeDefinition setSrid(final SRID srid) { this.srid = srid; return this; } @Override - public List getAnnotations() { + public List getAnnotations() { return annotations; } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java deleted file mode 100644 index f3511d76f..000000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * 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.commons.api.edm.provider; - -import java.util.List; - -import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -public interface EdmProvider { - - /** - * This method should return an {@link EnumType} or null if nothing is found - * - * @param enumTypeName - * @return {@link EnumType} for given name - * @throws ODataException - */ - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException; - - /** - * This method should return an {@link TypeDefinition} or null if nothing is found - * - * @param typeDefinitionName - * @return {@link TypeDefinition} for given name - * @throws ODataException - */ - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException; - - /** - * This method should return an {@link EntityType} or null if nothing is found - * - * @param entityTypeName - * @return {@link EntityType} for the given name - * @throws ODataException - */ - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException; - - /** - * This method should return a {@link ComplexType} or null if nothing is found. - * - * @param complexTypeName - * @return {@link ComplexType} for the given name - * @throws ODataException - */ - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException; - - /** - * This method should return a list of all {@link Action} for the FullQualifiedname or null if nothing is found - * - * @param actionName - * @return List of {@link Action} or null - * @throws ODataException - */ - public List getActions(final FullQualifiedName actionName) throws ODataException; - - /** - * This method should return a list of all {@link Function} for the FullQualifiedname or null if nothing is - * found - * - * @param functionName - * @return List of {@link Function} or null - * @throws ODataException - */ - public List getFunctions(final FullQualifiedName functionName) throws ODataException; - - /** - * This method should return a {@link Term} for the FullQualifiedName or null if nothing is found. - * @param termName the name of the Term - * @return {@link Term} or null - * @throws ODataException - */ - public Term getTerm(final FullQualifiedName termName) throws ODataException; - - /** - * This method should return an {@link EntitySet} or null if nothing is found - * - * @param entityContainer this EntitySet is contained in - * @param entitySetName - * @return {@link EntitySet} for the given container and entityset name - * @throws ODataException - */ - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) - throws ODataException; - - /** - * This method should return an {@link Singleton} or null if nothing is found - * - * @param entityContainer this Singleton is contained in - * @param singletonName - * @return {@link Singleton} for given container and singleton name - * @throws ODataException - */ - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) - throws ODataException; - - /** - * This method should return an {@link ActionImport} or null if nothing is found - * - * @param entityContainer this ActionImport is contained in - * @param actionImportName - * @return {@link ActionImport} for the given container and ActionImport name - * @throws ODataException - */ - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) - throws ODataException; - - /** - * This method should return a {@link FunctionImport} or null if nothing is found - * - * @param entityContainer this FunctionImport is contained in - * @param functionImportName - * @return {@link FunctionImport} for the given container name and function import name - * @throws ODataException - */ - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) - throws ODataException; - - /** - * This method should return an {@link EntityContainerInfo} or null if nothing is found - * - * @param entityContainerName (null for default container) - * @return {@link EntityContainerInfo} for the given name - * @throws ODataException - */ - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException; - - /** - * This method should return a list of all namespaces which have an alias - * - * @return List of alias info - * @throws ODataException - */ - public List getAliasInfos() throws ODataException; - - /** - * This method should return a collection of all {@link Schema} - * - * @return List<{@link Schema}> - * @throws ODataException - */ - public List getSchemas() throws ODataException; - - /** - * Returns the entity container of this edm - * @return {@link EntityContainer} of this edm - */ - public EntityContainer getEntityContainer() throws ODataException; - - /** - * @param targetName - * @return {@link Annotations} group for the given Target - */ - public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException; - - /** - * @param annotatedName - * @return Annotatble element by target name - */ - public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException; -} diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java index 0cea34479..1490b8925 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java @@ -20,9 +20,9 @@ package org.apache.olingo.commons.api.edm.provider.annotation; import java.util.List; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface Apply extends DynamicAnnotationExpression, Annotatable { +public interface Apply extends DynamicAnnotationExpression, CsdlAnnotatable { String getFunction(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java index a091fe006..49011f36e 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java @@ -19,9 +19,9 @@ package org.apache.olingo.commons.api.edm.provider.annotation; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface Cast extends DynamicAnnotationExpression, Annotatable { +public interface Cast extends DynamicAnnotationExpression, CsdlAnnotatable { Integer getMaxLength(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java index 86661c29e..e035efec3 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface If extends DynamicAnnotationExpression, Annotatable { +public interface If extends DynamicAnnotationExpression, CsdlAnnotatable { AnnotationExpression getGuard(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java index 6bbc6b5cb..c66374cfa 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java @@ -19,9 +19,9 @@ package org.apache.olingo.commons.api.edm.provider.annotation; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface IsOf extends DynamicAnnotationExpression, Annotatable { +public interface IsOf extends DynamicAnnotationExpression, CsdlAnnotatable { Integer getMaxLength(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java index 2f1aace84..f2c5eaa67 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface LabeledElement extends DynamicAnnotationExpression, Annotatable { +public interface LabeledElement extends DynamicAnnotationExpression, CsdlAnnotatable { String getName(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java index 40345eede..a986fff55 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface Null extends DynamicAnnotationExpression, Annotatable { +public interface Null extends DynamicAnnotationExpression, CsdlAnnotatable { //No additional methods needed for now. } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java index acdf92e36..d33ed9ae3 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface PropertyValue extends DynamicAnnotationExpression, Annotatable { +public interface PropertyValue extends DynamicAnnotationExpression, CsdlAnnotatable { String getProperty(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java index 1344c30f4..10f23524e 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java @@ -20,9 +20,9 @@ package org.apache.olingo.commons.api.edm.provider.annotation; import java.util.List; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; -public interface Record extends DynamicAnnotationExpression, Annotatable { +public interface Record extends DynamicAnnotationExpression, CsdlAnnotatable { List getPropertyValues(); diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmAnnotatable.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmAnnotatable.java index 773ca9e7b..b62325d6a 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmAnnotatable.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmAnnotatable.java @@ -22,8 +22,8 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotatable; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmTerm; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; import java.util.ArrayList; import java.util.Collections; @@ -31,11 +31,11 @@ import java.util.List; public abstract class AbstractEdmAnnotatable implements EdmAnnotatable { - private final Annotatable annotatable; + private final CsdlAnnotatable annotatable; private List annotations; protected final Edm edm; - public AbstractEdmAnnotatable(final Edm edm, final Annotatable annotatable) { + public AbstractEdmAnnotatable(final Edm edm, final CsdlAnnotatable annotatable) { this.edm = edm; this.annotatable = annotatable; } @@ -57,7 +57,7 @@ public abstract class AbstractEdmAnnotatable implements EdmAnnotatable { if (annotations == null) { final List annotationsLocal = new ArrayList(); if (annotatable != null) { - for (Annotation annotation : annotatable.getAnnotations()) { + for (CsdlAnnotation annotation : annotatable.getAnnotations()) { annotationsLocal.add(new EdmAnnotationImpl(edm, annotation)); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java index 62f12e60a..d9503ccc1 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java @@ -30,17 +30,17 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmNavigationPropertyBinding; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.BindingTarget; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlBindingTarget; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; public abstract class AbstractEdmBindingTarget extends AbstractEdmNamed implements EdmBindingTarget { - private final BindingTarget target; + private final CsdlBindingTarget target; private final EdmEntityContainer container; private List navigationPropertyBindings; - public AbstractEdmBindingTarget(final Edm edm, final EdmEntityContainer container, final BindingTarget target) { + public AbstractEdmBindingTarget(final Edm edm, final EdmEntityContainer container, final CsdlBindingTarget target) { super(edm, target.getName(), target); this.container = container; this.target = target; @@ -49,11 +49,11 @@ public abstract class AbstractEdmBindingTarget extends AbstractEdmNamed implemen @Override public List getNavigationPropertyBindings() { if (navigationPropertyBindings == null) { - List providerBindings = target.getNavigationPropertyBindings(); + List providerBindings = target.getNavigationPropertyBindings(); final List navigationPropertyBindingsLocal = new ArrayList(); if (providerBindings != null) { - for (NavigationPropertyBinding binding : providerBindings) { + for (CsdlNavigationPropertyBinding binding : providerBindings) { navigationPropertyBindingsLocal.add(new EdmNavigationPropertyBindingImpl(binding.getPath(), binding.getTarget())); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNamed.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNamed.java index ced2b92c3..36638fd71 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNamed.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNamed.java @@ -20,13 +20,13 @@ package org.apache.olingo.commons.core.edm; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmNamed; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; public abstract class AbstractEdmNamed extends AbstractEdmAnnotatable implements EdmNamed { private final String name; - public AbstractEdmNamed(final Edm edm, final String name, final Annotatable annotatable) { + public AbstractEdmNamed(final Edm edm, final String name, final CsdlAnnotatable annotatable) { super(edm, annotatable); this.name = name; } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java index 6fc4f9177..d5dd4be32 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java @@ -33,17 +33,17 @@ import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Operation; -import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.CsdlOperation; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOperation { - private final Operation operation; + private final CsdlOperation operation; private Map parameters; private List parameterNames; private EdmReturnType returnType; - protected AbstractEdmOperation(final Edm edm, final FullQualifiedName name, final Operation operation, + protected AbstractEdmOperation(final Edm edm, final FullQualifiedName name, final CsdlOperation operation, final EdmTypeKind kind) { super(edm, name, kind, operation); @@ -69,10 +69,10 @@ public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOpe private void createParameters() { if(parameters == null) { final Map parametersLocal = new LinkedHashMap(); - final List providerParameters = operation.getParameters(); + final List providerParameters = operation.getParameters(); if (providerParameters != null) { final List parameterNamesLocal = new ArrayList(providerParameters.size()); - for (Parameter parameter : providerParameters) { + for (CsdlParameter parameter : providerParameters) { parametersLocal.put(parameter.getName(), new EdmParameterImpl(edm, parameter)); parameterNamesLocal.add(parameter.getName()); } @@ -120,7 +120,7 @@ public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOpe @Override public FullQualifiedName getBindingParameterTypeFqn() { if (isBound()) { - Parameter bindingParameter = operation.getParameters().get(0); + CsdlParameter bindingParameter = operation.getParameters().get(0); return bindingParameter.getTypeFQN(); } return null; @@ -129,7 +129,7 @@ public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOpe @Override public Boolean isBindingParameterTypeCollection() { if (isBound()) { - Parameter bindingParameter = operation.getParameters().get(0); + CsdlParameter bindingParameter = operation.getParameters().get(0); return bindingParameter.isCollection(); } return null; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java index c36c44f3b..356500a9c 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java @@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmOperationImport; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.OperationImport; +import org.apache.olingo.commons.api.edm.provider.CsdlOperationImport; public abstract class AbstractEdmOperationImport extends AbstractEdmNamed implements EdmOperationImport { @@ -33,7 +33,7 @@ public abstract class AbstractEdmOperationImport extends AbstractEdmNamed implem private EdmEntitySet returnedEntitySet; public AbstractEdmOperationImport(final Edm edm, final EdmEntityContainer container, - final OperationImport operationImport) { + final CsdlOperationImport operationImport) { super(edm, operationImport.getName(), operationImport); this.container = container; if (operationImport.getEntitySet() != null) { diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java index 736b69b0f..1c96a6b79 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java @@ -27,9 +27,9 @@ import org.apache.olingo.commons.api.edm.EdmStructuredType; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.StructuralType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlStructuralType; import java.util.ArrayList; import java.util.Collections; @@ -42,7 +42,7 @@ public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements E protected EdmStructuredType baseType; protected FullQualifiedName baseTypeName; - private final StructuralType providerStructuredType; + private final CsdlStructuralType providerStructuredType; private List propertyNames; private Map properties; @@ -53,7 +53,7 @@ public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements E final Edm edm, final FullQualifiedName typeName, final EdmTypeKind kind, - final StructuralType structuredType) { + final CsdlStructuralType structuredType) { super(edm, typeName, kind, structuredType); this.baseTypeName = structuredType.getBaseTypeFQN(); @@ -158,8 +158,8 @@ public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements E public Map getProperties() { if (properties == null) { final Map localPorperties = new LinkedHashMap(); - final List structureTypeProperties = providerStructuredType.getProperties(); - for (Property property : structureTypeProperties) { + final List structureTypeProperties = providerStructuredType.getProperties(); + for (CsdlProperty property : structureTypeProperties) { localPorperties.put(property.getName(), new EdmPropertyImpl(edm, typeName, property)); } properties = Collections.unmodifiableMap(localPorperties); @@ -171,11 +171,11 @@ public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements E if (navigationProperties == null) { final Map localNavigationProperties = new LinkedHashMap(); - final List structuredTypeNavigationProperties = + final List structuredTypeNavigationProperties = providerStructuredType.getNavigationProperties(); if (structuredTypeNavigationProperties != null) { - for (NavigationProperty navigationProperty : structuredTypeNavigationProperties) { + for (CsdlNavigationProperty navigationProperty : structuredTypeNavigationProperties) { localNavigationProperties.put(navigationProperty.getName(), new EdmNavigationPropertyImpl(edm, typeName, navigationProperty)); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImpl.java index 91296d52a..a7b42d3f8 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImpl.java @@ -22,11 +22,11 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; public class EdmActionImpl extends AbstractEdmOperation implements EdmAction { - public EdmActionImpl(final Edm edm, final FullQualifiedName name, final Action action) { + public EdmActionImpl(final Edm edm, final FullQualifiedName name, final CsdlAction action) { super(edm, name, action, EdmTypeKind.ACTION); } } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportImpl.java index 43e2f0ba1..c36b94730 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportImpl.java @@ -22,13 +22,13 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmActionImport; import org.apache.olingo.commons.api.edm.EdmEntityContainer; -import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; public class EdmActionImportImpl extends AbstractEdmOperationImport implements EdmActionImport { - private final ActionImport actionImport; + private final CsdlActionImport actionImport; - public EdmActionImportImpl(final Edm edm, final EdmEntityContainer container, final ActionImport actionImport) { + public EdmActionImportImpl(final Edm edm, final EdmEntityContainer container, final CsdlActionImport actionImport) { super(edm, container, actionImport); this.actionImport = actionImport; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java index 8006639d8..f38a2bcc1 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java @@ -29,8 +29,8 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue; @@ -62,11 +62,11 @@ import org.apache.olingo.commons.core.edm.annotation.EdmUrlRefImpl; public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnnotation { - private final Annotation annotation; + private final CsdlAnnotation annotation; private EdmTerm term; private EdmAnnotationExpression expression; - public EdmAnnotationImpl(final Edm edm, final Annotation annotation) { + public EdmAnnotationImpl(final Edm edm, final CsdlAnnotation annotation) { super(edm, annotation); this.annotation = annotation; } @@ -206,8 +206,8 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno _expression = new EdmUrlRefImpl(getExpression(exp.asUrlRef().getValue())); } - if (_expression instanceof EdmAnnotatable && exp instanceof Annotatable) { - for (Annotation _annotation : ((Annotatable) exp).getAnnotations()) { + if (_expression instanceof EdmAnnotatable && exp instanceof CsdlAnnotatable) { + for (CsdlAnnotation _annotation : ((CsdlAnnotatable) exp).getAnnotations()) { ((EdmAnnotatable) _expression).getAnnotations().add(new EdmAnnotationImpl(edm, _annotation)); } } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationsImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationsImpl.java index 0b10b179a..772838bb0 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationsImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationsImpl.java @@ -33,18 +33,18 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmStructuredType; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Annotation; -import org.apache.olingo.commons.api.edm.provider.Annotations; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; public class EdmAnnotationsImpl implements EdmAnnotations { private final Edm edm; private final EdmSchema schema; - private final Annotations annotationGroup; + private final CsdlAnnotations annotationGroup; private EdmAnnotationsTarget target; private List annotations; - public EdmAnnotationsImpl(final Edm edm, final EdmSchema schema, final Annotations annotationGroup) { + public EdmAnnotationsImpl(final Edm edm, final EdmSchema schema, final CsdlAnnotations annotationGroup) { this.edm = edm; this.schema = schema; this.annotationGroup = annotationGroup; @@ -139,7 +139,7 @@ public class EdmAnnotationsImpl implements EdmAnnotations { public List getAnnotations() { if (annotations == null) { List annotationsLocal = new ArrayList(); - for (Annotation annotation : annotationGroup.getAnnotations()) { + for (CsdlAnnotation annotation : annotationGroup.getAnnotations()) { annotationsLocal.add(new EdmAnnotationImpl(edm, annotation)); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmComplexTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmComplexTypeImpl.java index d39d594bd..20e083635 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmComplexTypeImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmComplexTypeImpl.java @@ -24,11 +24,11 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmStructuredType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; public class EdmComplexTypeImpl extends AbstractEdmStructuredType implements EdmComplexType { - public EdmComplexTypeImpl(final Edm edm, final FullQualifiedName name, final ComplexType complexType) { + public EdmComplexTypeImpl(final Edm edm, final FullQualifiedName name, final CsdlComplexType complexType) { super(edm, name, EdmTypeKind.COMPLEX, complexType); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java index 2c6d871ef..3112f4bd6 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java @@ -33,18 +33,18 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntityContainer { - private final EdmProvider provider; - private EntityContainer container; + private final CsdlEdmProvider provider; + private CsdlEntityContainer container; private final FullQualifiedName entityContainerName; private final FullQualifiedName parentContainerName; @@ -62,16 +62,16 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit private final Map functionImportCache = Collections.synchronizedMap( new LinkedHashMap()); - public EdmEntityContainerImpl(final Edm edm, final EdmProvider provider, - final EntityContainerInfo entityContainerInfo) { + public EdmEntityContainerImpl(final Edm edm, final CsdlEdmProvider provider, + final CsdlEntityContainerInfo entityContainerInfo) { super(edm, entityContainerInfo.getContainerName().getName(), null); this.provider = provider; this.entityContainerName = entityContainerInfo.getContainerName(); this.parentContainerName = entityContainerInfo.getExtendsContainer(); } - public EdmEntityContainerImpl(final Edm edm, final EdmProvider provider, final FullQualifiedName containerFQN, - final EntityContainer entityContainer) { + public EdmEntityContainerImpl(final Edm edm, final CsdlEdmProvider provider, final FullQualifiedName containerFQN, + final CsdlEntityContainer entityContainer) { super(edm, containerFQN.getName(), entityContainer); this.provider = provider; container = entityContainer; @@ -178,7 +178,7 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit EdmSingleton singleton = null; try { - final Singleton providerSingleton = provider.getSingleton(entityContainerName, singletonName); + final CsdlSingleton providerSingleton = provider.getSingleton(entityContainerName, singletonName); if (providerSingleton != null) { singleton = new EdmSingletonImpl(edm, this, providerSingleton); } @@ -193,7 +193,7 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit EdmEntitySet entitySet = null; try { - final EntitySet providerEntitySet = provider.getEntitySet(entityContainerName, entitySetName); + final CsdlEntitySet providerEntitySet = provider.getEntitySet(entityContainerName, entitySetName); if (providerEntitySet != null) { entitySet = new EdmEntitySetImpl(edm, this, providerEntitySet); } @@ -208,7 +208,7 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit EdmActionImport actionImport = null; try { - final ActionImport providerImport = provider.getActionImport(entityContainerName, actionImportName); + final CsdlActionImport providerImport = provider.getActionImport(entityContainerName, actionImportName); if (providerImport != null) { actionImport = new EdmActionImportImpl(edm, this, providerImport); } @@ -223,7 +223,7 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit EdmFunctionImport functionImport = null; try { - final FunctionImport providerImport = provider.getFunctionImport(entityContainerName, functionImportName); + final CsdlFunctionImport providerImport = provider.getFunctionImport(entityContainerName, functionImportName); if (providerImport != null) { functionImport = new EdmFunctionImportImpl(edm, this, providerImport); } @@ -236,11 +236,11 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit protected void loadAllEntitySets() { loadContainer(); - final List providerEntitySets = container.getEntitySets(); + final List providerEntitySets = container.getEntitySets(); final List entitySetsLocal = new ArrayList(); if (providerEntitySets != null) { - for (EntitySet entitySet : providerEntitySets) { + for (CsdlEntitySet entitySet : providerEntitySets) { final EdmEntitySetImpl impl = new EdmEntitySetImpl(edm, this, entitySet); entitySetCache.put(impl.getName(), impl); entitySetsLocal.add(impl); @@ -251,11 +251,11 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit protected void loadAllFunctionImports() { loadContainer(); - final List providerFunctionImports = container.getFunctionImports(); + final List providerFunctionImports = container.getFunctionImports(); final ArrayList functionImportsLocal = new ArrayList(); if (providerFunctionImports != null) { - for (FunctionImport functionImport : providerFunctionImports) { + for (CsdlFunctionImport functionImport : providerFunctionImports) { EdmFunctionImportImpl impl = new EdmFunctionImportImpl(edm, this, functionImport); functionImportCache.put(impl.getName(), impl); functionImportsLocal.add(impl); @@ -266,11 +266,11 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit protected void loadAllSingletons() { loadContainer(); - final List providerSingletons = container.getSingletons(); + final List providerSingletons = container.getSingletons(); final List singletonsLocal = new ArrayList(); if (providerSingletons != null) { - for (Singleton singleton : providerSingletons) { + for (CsdlSingleton singleton : providerSingletons) { final EdmSingletonImpl impl = new EdmSingletonImpl(edm, this, singleton); singletonCache.put(singleton.getName(), impl); singletonsLocal.add(impl); @@ -281,11 +281,11 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit protected void loadAllActionImports() { loadContainer(); - final List providerActionImports = container.getActionImports(); + final List providerActionImports = container.getActionImports(); final List actionImportsLocal = new ArrayList(); if (providerActionImports != null) { - for (ActionImport actionImport : providerActionImports) { + for (CsdlActionImport actionImport : providerActionImports) { final EdmActionImportImpl impl = new EdmActionImportImpl(edm, this, actionImport); actionImportCache.put(actionImport.getName(), impl); actionImportsLocal.add(impl); @@ -298,9 +298,9 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit private void loadContainer() { if (container == null) { try { - EntityContainer containerLocal = provider.getEntityContainer(); + CsdlEntityContainer containerLocal = provider.getEntityContainer(); if (containerLocal == null) { - containerLocal = new EntityContainer().setName(getName()); + containerLocal = new CsdlEntityContainer().setName(getName()); } container = containerLocal; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetImpl.java index 2d4bd0d5c..a84084139 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.commons.core.edm; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; -import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; public class EdmEntitySetImpl extends AbstractEdmBindingTarget implements EdmEntitySet { - private EntitySet entitySet; + private CsdlEntitySet entitySet; - public EdmEntitySetImpl(final Edm edm, final EdmEntityContainer container, final EntitySet entitySet) { + public EdmEntitySetImpl(final Edm edm, final EdmEntityContainer container, final CsdlEntitySet entitySet) { super(edm, container, entitySet); this.entitySet = entitySet; } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityTypeImpl.java index e6fefca8d..73d87582f 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityTypeImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityTypeImpl.java @@ -31,12 +31,12 @@ import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef; import org.apache.olingo.commons.api.edm.EdmStructuredType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; public class EdmEntityTypeImpl extends AbstractEdmStructuredType implements EdmEntityType { - private EntityType entityType; + private CsdlEntityType entityType; private boolean baseTypeChecked = false; private final boolean hasStream; protected EdmEntityType entityBaseType; @@ -45,7 +45,7 @@ public class EdmEntityTypeImpl extends AbstractEdmStructuredType implements EdmE Collections.synchronizedMap(new LinkedHashMap()); private List keyPropertyRefsList; - public EdmEntityTypeImpl(final Edm edm, final FullQualifiedName name, final EntityType entityType) { + public EdmEntityTypeImpl(final Edm edm, final FullQualifiedName name, final CsdlEntityType entityType) { super(edm, name, EdmTypeKind.ENTITY, entityType); this.entityType = entityType; hasStream = entityType.hasStream(); @@ -60,10 +60,10 @@ public class EdmEntityTypeImpl extends AbstractEdmStructuredType implements EdmE } if (baseType == null || (baseType.isAbstract() && ((EdmEntityType) baseType).getKeyPropertyRefs().size() == 0)) { - final List key = entityType.getKey(); + final List key = entityType.getKey(); if (key != null) { final List edmKey = new ArrayList(); - for (PropertyRef ref : key) { + for (CsdlPropertyRef ref : key) { edmKey.add(new EdmKeyPropertyRefImpl(this, ref)); } setEdmKeyPropertyRef(edmKey); diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEnumTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEnumTypeImpl.java index 95866fd94..d04e4060d 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEnumTypeImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEnumTypeImpl.java @@ -35,8 +35,8 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.EnumMember; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import org.apache.olingo.commons.core.edm.primitivetype.EdmInt64; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; @@ -52,13 +52,13 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType { } private final EdmPrimitiveType underlyingType; - private final EnumType enumType; + private final CsdlEnumType enumType; private final String uriPrefix; private final String uriSuffix; private List memberNames; private LinkedHashMap membersMap; - public EdmEnumTypeImpl(final Edm edm, final FullQualifiedName enumName, final EnumType enumType) { + public EdmEnumTypeImpl(final Edm edm, final FullQualifiedName enumName, final CsdlEnumType enumType) { super(edm, enumName, EdmTypeKind.ENUM, enumType); if (enumType.getUnderlyingType() == null) { @@ -102,7 +102,7 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType { final LinkedHashMap membersMapLocal = new LinkedHashMap(); final List memberNamesLocal = new ArrayList(); if (enumType.getMembers() != null) { - for (final EnumMember member : enumType.getMembers()) { + for (final CsdlEnumMember member : enumType.getMembers()) { membersMapLocal.put(member.getName(), new EdmMemberImpl(edm, getFullQualifiedName(), member)); memberNamesLocal.add(member.getName()); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImpl.java index 01d20eaf5..8ed366beb 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImpl.java @@ -24,13 +24,13 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; public class EdmFunctionImpl extends AbstractEdmOperation implements EdmFunction { - private final Function function; + private final CsdlFunction function; - public EdmFunctionImpl(final Edm edm, final FullQualifiedName name, final Function function) { + public EdmFunctionImpl(final Edm edm, final FullQualifiedName name, final CsdlFunction function) { super(edm, name, function, EdmTypeKind.FUNCTION); this.function = function; } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportImpl.java index ea9037d71..64a80c6de 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportImpl.java @@ -25,13 +25,14 @@ import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; public class EdmFunctionImportImpl extends AbstractEdmOperationImport implements EdmFunctionImport { - private final FunctionImport functionImport; + private final CsdlFunctionImport functionImport; - public EdmFunctionImportImpl(final Edm edm, final EdmEntityContainer container, final FunctionImport functionImport) { + public EdmFunctionImportImpl(final Edm edm, final EdmEntityContainer container, + final CsdlFunctionImport functionImport) { super(edm, container, functionImport); this.functionImport = functionImport; } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmKeyPropertyRefImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmKeyPropertyRefImpl.java index 0f69deb54..13199eebf 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmKeyPropertyRefImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmKeyPropertyRefImpl.java @@ -23,15 +23,15 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmStructuredType; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; public class EdmKeyPropertyRefImpl implements EdmKeyPropertyRef { - private final PropertyRef ref; + private final CsdlPropertyRef ref; private EdmEntityType edmEntityType; private EdmProperty property; - public EdmKeyPropertyRefImpl(final EdmEntityType edmEntityType, final PropertyRef ref) { + public EdmKeyPropertyRefImpl(final EdmEntityType edmEntityType, final CsdlPropertyRef ref) { this.edmEntityType = edmEntityType; this.ref = ref; } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java index 362dd7219..7fd05e4b1 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java @@ -21,14 +21,14 @@ package org.apache.olingo.commons.core.edm; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmMember; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; public class EdmMemberImpl extends AbstractEdmNamed implements EdmMember { private final FullQualifiedName enumFQN; - private final EnumMember member; + private final CsdlEnumMember member; - public EdmMemberImpl(final Edm edm, final FullQualifiedName enumFQN, final EnumMember member) { + public EdmMemberImpl(final Edm edm, final FullQualifiedName enumFQN, final CsdlEnumMember member) { super(edm, member.getName(), member); this.enumFQN = enumFQN; this.member = member; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNavigationPropertyImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNavigationPropertyImpl.java index 71f0a5746..2904deac0 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNavigationPropertyImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNavigationPropertyImpl.java @@ -30,19 +30,19 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmReferentialConstraint; import org.apache.olingo.commons.api.edm.EdmStructuredType; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint; public class EdmNavigationPropertyImpl extends AbstractEdmNamed implements EdmElement, EdmNavigationProperty { private final FullQualifiedName structuredTypeName; - private final NavigationProperty navigationProperty; + private final CsdlNavigationProperty navigationProperty; private List referentialConstraints; private EdmEntityType typeImpl; private EdmNavigationProperty partnerNavigationProperty; public EdmNavigationPropertyImpl( - final Edm edm, final FullQualifiedName structuredTypeName, final NavigationProperty navigationProperty) { + final Edm edm, final FullQualifiedName structuredTypeName, final CsdlNavigationProperty navigationProperty) { super(edm, navigationProperty.getName(), navigationProperty); this.structuredTypeName = structuredTypeName; this.navigationProperty = navigationProperty; @@ -98,9 +98,9 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNamed implements EdmEl @Override public String getReferencingPropertyName(final String referencedPropertyName) { - final List referentialConstraints = navigationProperty.getReferentialConstraints(); + final List referentialConstraints = navigationProperty.getReferentialConstraints(); if (referentialConstraints != null) { - for (ReferentialConstraint constraint : referentialConstraints) { + for (CsdlReferentialConstraint constraint : referentialConstraints) { if (constraint.getReferencedProperty().equals(referencedPropertyName)) { return constraint.getProperty(); } @@ -112,10 +112,10 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNamed implements EdmEl @Override public List getReferentialConstraints() { if (referentialConstraints == null) { - final List providerConstraints = navigationProperty.getReferentialConstraints(); + final List providerConstraints = navigationProperty.getReferentialConstraints(); final List referentialConstraintsLocal = new ArrayList(); if (providerConstraints != null) { - for (ReferentialConstraint constraint : providerConstraints) { + for (CsdlReferentialConstraint constraint : providerConstraints) { referentialConstraintsLocal.add(new EdmReferentialConstraintImpl(edm, constraint)); } } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmParameterImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmParameterImpl.java index e32bc6fcf..33f2fd088 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmParameterImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmParameterImpl.java @@ -25,15 +25,15 @@ import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; public class EdmParameterImpl extends AbstractEdmNamed implements EdmParameter, EdmElement { - private final Parameter parameter; + private final CsdlParameter parameter; private final EdmTypeInfo typeInfo; private EdmType typeImpl; - public EdmParameterImpl(final Edm edm, final Parameter parameter) { + public EdmParameterImpl(final Edm edm, final CsdlParameter parameter) { super(edm, parameter.getName(), parameter); this.parameter = parameter; this.typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(parameter.getType()).build(); diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmPropertyImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmPropertyImpl.java index 494744bc1..853e23578 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmPropertyImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmPropertyImpl.java @@ -26,16 +26,16 @@ import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; public class EdmPropertyImpl extends AbstractEdmNamed implements EdmProperty, EdmElement { private final FullQualifiedName structuredTypeName; - private final Property property; + private final CsdlProperty property; private final EdmTypeInfo typeInfo; private EdmType propertyType; - public EdmPropertyImpl(final Edm edm, final FullQualifiedName structuredTypeName, final Property property) { + public EdmPropertyImpl(final Edm edm, final FullQualifiedName structuredTypeName, final CsdlProperty property) { super(edm, property.getName(), property); this.structuredTypeName = structuredTypeName; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java index 62efd32f1..4f3c00474 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java @@ -39,38 +39,38 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotation; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; public class EdmProviderImpl extends AbstractEdm { - private final EdmProvider provider; - private final Map> actionsMap = - Collections.synchronizedMap(new HashMap>()); - private final Map> functionsMap = - Collections.synchronizedMap(new HashMap>()); + private final CsdlEdmProvider provider; + private final Map> actionsMap = + Collections.synchronizedMap(new HashMap>()); + private final Map> functionsMap = + Collections.synchronizedMap(new HashMap>()); - public EdmProviderImpl(final EdmProvider provider) { + public EdmProviderImpl(final CsdlEdmProvider provider) { this.provider = provider; } @Override public EdmEntityContainer createEntityContainer(final FullQualifiedName containerName) { try { - EntityContainerInfo entityContainerInfo = provider.getEntityContainerInfo(containerName); + CsdlEntityContainerInfo entityContainerInfo = provider.getEntityContainerInfo(containerName); if (entityContainerInfo != null) { return new EdmEntityContainerImpl(this, provider, entityContainerInfo); } @@ -83,7 +83,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override public EdmEnumType createEnumType(final FullQualifiedName enumName) { try { - EnumType enumType = provider.getEnumType(enumName); + CsdlEnumType enumType = provider.getEnumType(enumName); if (enumType != null) { return new EdmEnumTypeImpl(this, enumName, enumType); } @@ -96,7 +96,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override public EdmTypeDefinition createTypeDefinition(final FullQualifiedName typeDefinitionName) { try { - TypeDefinition typeDefinition = provider.getTypeDefinition(typeDefinitionName); + CsdlTypeDefinition typeDefinition = provider.getTypeDefinition(typeDefinitionName); if (typeDefinition != null) { return new EdmTypeDefinitionImpl(this, typeDefinitionName, typeDefinition); } @@ -109,7 +109,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override public EdmEntityType createEntityType(final FullQualifiedName entityTypeName) { try { - EntityType entityType = provider.getEntityType(entityTypeName); + CsdlEntityType entityType = provider.getEntityType(entityTypeName); if (entityType != null) { return new EdmEntityTypeImpl(this, entityTypeName, entityType); } @@ -122,7 +122,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override public EdmComplexType createComplexType(final FullQualifiedName complexTypeName) { try { - final ComplexType complexType = provider.getComplexType(complexTypeName); + final CsdlComplexType complexType = provider.getComplexType(complexTypeName); if (complexType != null) { return new EdmComplexTypeImpl(this, complexTypeName, complexType); } @@ -137,7 +137,7 @@ public class EdmProviderImpl extends AbstractEdm { final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection) { try { - List actions = actionsMap.get(actionName); + List actions = actionsMap.get(actionName); if (actions == null) { actions = provider.getActions(actionName); if (actions == null) { @@ -147,10 +147,10 @@ public class EdmProviderImpl extends AbstractEdm { } } // Search for bound action where binding parameter matches - for (Action action : actions) { + for (CsdlAction action : actions) { if (action.isBound()) { - final List parameters = action.getParameters(); - final Parameter parameter = parameters.get(0); + final List parameters = action.getParameters(); + final CsdlParameter parameter = parameters.get(0); if (bindingParameterTypeName.equals(parameter.getTypeFQN()) && isBindingParameterCollection.booleanValue() == parameter.isCollection()) { @@ -171,7 +171,7 @@ public class EdmProviderImpl extends AbstractEdm { final List parameterNames) { try { - List functions = functionsMap.get(functionName); + List functions = functionsMap.get(functionName); if (functions == null) { functions = provider.getFunctions(functionName); if (functions == null) { @@ -182,13 +182,13 @@ public class EdmProviderImpl extends AbstractEdm { } final List parameterNamesCopy = parameterNames == null ? Collections. emptyList() : parameterNames; - for (Function function : functions) { + for (CsdlFunction function : functions) { if (function.isBound()) { - List providerParameters = function.getParameters(); + List providerParameters = function.getParameters(); if (providerParameters == null || providerParameters.size() == 0) { throw new EdmException("No parameter specified for bound function: " + functionName); } - final Parameter bindingParameter = providerParameters.get(0); + final CsdlParameter bindingParameter = providerParameters.get(0); if (bindingParameterTypeName.equals(bindingParameter.getTypeFQN()) && isBindingParameterCollection.booleanValue() == bindingParameter.isCollection()) { @@ -214,9 +214,9 @@ public class EdmProviderImpl extends AbstractEdm { protected Map createAliasToNamespaceInfo() { final Map aliasToNamespaceInfos = new HashMap(); try { - final List aliasInfos = provider.getAliasInfos(); + final List aliasInfos = provider.getAliasInfos(); if (aliasInfos != null) { - for (AliasInfo info : aliasInfos) { + for (CsdlAliasInfo info : aliasInfos) { aliasToNamespaceInfos.put(info.getAlias(), info.getNamespace()); } } @@ -229,7 +229,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override protected EdmAction createUnboundAction(final FullQualifiedName actionName) { try { - List actions = actionsMap.get(actionName); + List actions = actionsMap.get(actionName); if (actions == null) { actions = provider.getActions(actionName); if (actions == null) { @@ -239,7 +239,7 @@ public class EdmProviderImpl extends AbstractEdm { } } // Search for first unbound action - for (Action action : actions) { + for (CsdlAction action : actions) { if (!action.isBound()) { return new EdmActionImpl(this, actionName, action); } @@ -255,7 +255,7 @@ public class EdmProviderImpl extends AbstractEdm { List result = new ArrayList(); try { - List functions = functionsMap.get(functionName); + List functions = functionsMap.get(functionName); if (functions == null) { functions = provider.getFunctions(functionName); if (functions != null) { @@ -263,7 +263,7 @@ public class EdmProviderImpl extends AbstractEdm { } } if (functions != null) { - for (Function function : functions) { + for (CsdlFunction function : functions) { if (!function.isBound()) { result.add(new EdmFunctionImpl(this, functionName, function)); } @@ -279,7 +279,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override protected EdmFunction createUnboundFunction(final FullQualifiedName functionName, final List parameterNames) { try { - List functions = functionsMap.get(functionName); + List functions = functionsMap.get(functionName); if (functions == null) { functions = provider.getFunctions(functionName); if (functions == null) { @@ -291,15 +291,15 @@ public class EdmProviderImpl extends AbstractEdm { final List parameterNamesCopy = parameterNames == null ? Collections. emptyList() : parameterNames; - for (Function function : functions) { + for (CsdlFunction function : functions) { if (!function.isBound()) { - List providerParameters = function.getParameters(); + List providerParameters = function.getParameters(); if (providerParameters == null) { providerParameters = Collections.emptyList(); } if (parameterNamesCopy.size() == providerParameters.size()) { final List functionParameterNames = new ArrayList(); - for (Parameter parameter : providerParameters) { + for (CsdlParameter parameter : providerParameters) { functionParameterNames.add(parameter.getName()); } @@ -319,7 +319,7 @@ public class EdmProviderImpl extends AbstractEdm { protected Map createSchemas() { try { final Map providerSchemas = new LinkedHashMap(); - for (Schema schema : provider.getSchemas()) { + for (CsdlSchema schema : provider.getSchemas()) { providerSchemas.put(schema.getNamespace(), new EdmSchemaImpl(this, provider, schema)); } return providerSchemas; @@ -331,7 +331,7 @@ public class EdmProviderImpl extends AbstractEdm { @Override protected EdmTerm createTerm(final FullQualifiedName termName) { try { - Term providerTerm = provider.getTerm(termName); + CsdlTerm providerTerm = provider.getTerm(termName); if (providerTerm != null) { return new EdmTermImpl(this, termName.getNamespace(), providerTerm); } @@ -346,7 +346,7 @@ public class EdmProviderImpl extends AbstractEdm { protected EdmAnnotations createAnnotationGroup(final FullQualifiedName targetName) { try { EdmSchema schema = getSchema(targetName.getNamespace()); - Annotations providerGroup = provider.getAnnotationsGroup(targetName); + CsdlAnnotations providerGroup = provider.getAnnotationsGroup(targetName); if (providerGroup != null) { return new EdmAnnotationsImpl(this, schema, providerGroup); } @@ -359,10 +359,10 @@ public class EdmProviderImpl extends AbstractEdm { @Override protected List createAnnotations(final FullQualifiedName annotatedName) { try { - Annotatable providerAnnotatable = provider.getAnnoatatable(annotatedName); + CsdlAnnotatable providerAnnotatable = provider.getAnnoatatable(annotatedName); if (providerAnnotatable != null && providerAnnotatable.getAnnotations() != null) { List result = new ArrayList(); - for(Annotation annotation : providerAnnotatable.getAnnotations()){ + for(CsdlAnnotation annotation : providerAnnotatable.getAnnotations()){ //Load Term getTerm(new FullQualifiedName(annotation.getTerm())); result.add(new EdmAnnotationImpl(this, annotation)); diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReferentialConstraintImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReferentialConstraintImpl.java index e0e8f8518..739349998 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReferentialConstraintImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReferentialConstraintImpl.java @@ -20,13 +20,13 @@ package org.apache.olingo.commons.core.edm; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmReferentialConstraint; -import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint; public class EdmReferentialConstraintImpl extends AbstractEdmAnnotatable implements EdmReferentialConstraint { - private final ReferentialConstraint constraint; + private final CsdlReferentialConstraint constraint; - public EdmReferentialConstraintImpl(final Edm edm, final ReferentialConstraint constraint) { + public EdmReferentialConstraintImpl(final Edm edm, final CsdlReferentialConstraint constraint) { super(edm, constraint); this.constraint = constraint; } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReturnTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReturnTypeImpl.java index 04f6f9045..efd58c80e 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReturnTypeImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmReturnTypeImpl.java @@ -23,15 +23,15 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; public class EdmReturnTypeImpl implements EdmReturnType { - private final ReturnType returnType; + private final CsdlReturnType returnType; private final EdmTypeInfo typeInfo; private EdmType typeImpl; - public EdmReturnTypeImpl(final Edm edm, final ReturnType returnType) { + public EdmReturnTypeImpl(final Edm edm, final CsdlReturnType returnType) { this.returnType = returnType; this.typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(returnType.getType()).build(); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSchemaImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSchemaImpl.java index 5521b9236..1c7bb4cbd 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSchemaImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSchemaImpl.java @@ -34,23 +34,23 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.Annotation; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; public class EdmSchemaImpl implements EdmSchema { - private final Schema schema; + private final CsdlSchema schema; private final EdmProviderImpl edm; - private final EdmProvider provider; + private final CsdlEdmProvider provider; protected final String namespace; private final String alias; @@ -65,7 +65,7 @@ public class EdmSchemaImpl implements EdmSchema { private List annotations; private EdmEntityContainer entityContainer; - public EdmSchemaImpl(final EdmProviderImpl edm, final EdmProvider provider, final Schema schema) { + public EdmSchemaImpl(final EdmProviderImpl edm, final CsdlEdmProvider provider, final CsdlSchema schema) { this.edm = edm; this.provider = provider; this.schema = schema; @@ -161,9 +161,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createTypeDefinitions() { final List typeDefinitions = new ArrayList(); - final List providerTypeDefinitions = schema.getTypeDefinitions(); + final List providerTypeDefinitions = schema.getTypeDefinitions(); if (providerTypeDefinitions != null) { - for (TypeDefinition def : providerTypeDefinitions) { + for (CsdlTypeDefinition def : providerTypeDefinitions) { FullQualifiedName typeDefName = new FullQualifiedName(namespace, def.getName()); EdmTypeDefinitionImpl typeDefImpl = new EdmTypeDefinitionImpl(edm, typeDefName, def); typeDefinitions.add(typeDefImpl); @@ -175,9 +175,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createEnumTypes() { final List enumTypes = new ArrayList(); - final List providerEnumTypes = schema.getEnumTypes(); + final List providerEnumTypes = schema.getEnumTypes(); if (providerEnumTypes != null) { - for (EnumType enumType : providerEnumTypes) { + for (CsdlEnumType enumType : providerEnumTypes) { FullQualifiedName enumName = new FullQualifiedName(namespace, enumType.getName()); EdmEnumType enumTypeImpl = new EdmEnumTypeImpl(edm, enumName, enumType); enumTypes.add(enumTypeImpl); @@ -189,9 +189,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createEntityTypes() { final List entityTypes = new ArrayList(); - final List providerEntityTypes = schema.getEntityTypes(); + final List providerEntityTypes = schema.getEntityTypes(); if (providerEntityTypes != null) { - for (EntityType entityType : providerEntityTypes) { + for (CsdlEntityType entityType : providerEntityTypes) { FullQualifiedName entityTypeName = new FullQualifiedName(namespace, entityType.getName()); EdmEntityTypeImpl entityTypeImpl = new EdmEntityTypeImpl(edm, entityTypeName, entityType); entityTypes.add(entityTypeImpl); @@ -203,9 +203,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createComplexTypes() { final List complexTypes = new ArrayList(); - final List providerComplexTypes = schema.getComplexTypes(); + final List providerComplexTypes = schema.getComplexTypes(); if (providerComplexTypes != null) { - for (ComplexType complexType : providerComplexTypes) { + for (CsdlComplexType complexType : providerComplexTypes) { FullQualifiedName comlexTypeName = new FullQualifiedName(namespace, complexType.getName()); EdmComplexTypeImpl complexTypeImpl = new EdmComplexTypeImpl(edm, comlexTypeName, complexType); complexTypes.add(complexTypeImpl); @@ -217,9 +217,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createActions() { final List actions = new ArrayList(); - final List providerActions = schema.getActions(); + final List providerActions = schema.getActions(); if (providerActions != null) { - for (Action action : providerActions) { + for (CsdlAction action : providerActions) { FullQualifiedName actionName = new FullQualifiedName(namespace, action.getName()); EdmActionImpl edmActionImpl = new EdmActionImpl(edm, actionName, action); actions.add(edmActionImpl); @@ -231,9 +231,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createFunctions() { final List functions = new ArrayList(); - final List providerFunctions = schema.getFunctions(); + final List providerFunctions = schema.getFunctions(); if (providerFunctions != null) { - for (Function function : providerFunctions) { + for (CsdlFunction function : providerFunctions) { FullQualifiedName functionName = new FullQualifiedName(namespace, function.getName()); EdmFunctionImpl functionImpl = new EdmFunctionImpl(edm, functionName, function); functions.add(functionImpl); @@ -245,9 +245,9 @@ public class EdmSchemaImpl implements EdmSchema { protected List createTerms() { final List terms = new ArrayList(); - final List providerTerms = schema.getTerms(); + final List providerTerms = schema.getTerms(); if (providerTerms != null) { - for (Term term : providerTerms) { + for (CsdlTerm term : providerTerms) { FullQualifiedName termName = new FullQualifiedName(namespace, term.getName()); EdmTermImpl termImpl = new EdmTermImpl(edm, getNamespace(), term); terms.add(termImpl); @@ -259,10 +259,10 @@ public class EdmSchemaImpl implements EdmSchema { protected List createAnnotationGroups() { final List annotationGroups = new ArrayList(); - final List providerAnnotations = + final List providerAnnotations = schema.getAnnotationGroups(); if (providerAnnotations != null) { - for (Annotations annotationGroup : providerAnnotations) { + for (CsdlAnnotations annotationGroup : providerAnnotations) { FullQualifiedName annotationsGroupName; if (annotationGroup.getTarget().contains(".")) { annotationsGroupName = new FullQualifiedName(annotationGroup.getTarget()); @@ -279,10 +279,10 @@ public class EdmSchemaImpl implements EdmSchema { protected List createAnnotations() { final List annotations = new ArrayList(); - final List providerAnnotations = + final List providerAnnotations = schema.getAnnotations(); if (providerAnnotations != null) { - for (Annotation annotation : providerAnnotations) { + for (CsdlAnnotation annotation : providerAnnotations) { EdmAnnotationImpl annotationImpl = new EdmAnnotationImpl(edm, annotation); annotations.add(annotationImpl); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonImpl.java index afb900fdf..c64a86638 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonImpl.java @@ -21,11 +21,11 @@ package org.apache.olingo.commons.core.edm; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmSingleton; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; public class EdmSingletonImpl extends AbstractEdmBindingTarget implements EdmSingleton { - public EdmSingletonImpl(final Edm edm, final EdmEntityContainer container, final Singleton singleton) { + public EdmSingletonImpl(final Edm edm, final EdmEntityContainer container, final CsdlSingleton singleton) { super(edm, container, singleton); } diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java index 8d72c83a9..efda3a7da 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java @@ -28,7 +28,7 @@ import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,14 +36,14 @@ import org.slf4j.LoggerFactory; public class EdmTermImpl extends AbstractEdmNamed implements EdmTerm { private static final Logger LOG = LoggerFactory.getLogger(EdmTermImpl.class); - private final Term term; + private final CsdlTerm term; private final FullQualifiedName fqn; private final EdmTypeInfo typeInfo; private EdmType termType; private EdmTerm baseTerm; private List> appliesTo; - public EdmTermImpl(final Edm edm, final String namespace, final Term term) { + public EdmTermImpl(final Edm edm, final String namespace, final CsdlTerm term) { super(edm, term.getName(), term); this.term = term; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeDefinitionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeDefinitionImpl.java index b42f6c68d..6e15f353f 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeDefinitionImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeDefinitionImpl.java @@ -27,17 +27,17 @@ import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; public class EdmTypeDefinitionImpl extends AbstractEdmNamed implements EdmTypeDefinition { - private TypeDefinition typeDefinition; + private CsdlTypeDefinition typeDefinition; private FullQualifiedName typeDefinitionName; private EdmPrimitiveType edmPrimitiveTypeInstance; public EdmTypeDefinitionImpl(final Edm edm, final FullQualifiedName typeDefinitionName, - final TypeDefinition typeDefinition) { + final CsdlTypeDefinition typeDefinition) { super(edm, typeDefinitionName.getName(), typeDefinition); this.typeDefinitionName = typeDefinitionName; this.typeDefinition = typeDefinition; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java index 630146b90..3b6f0704d 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java @@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; public class EdmTypeImpl extends AbstractEdmNamed implements EdmType { @@ -30,7 +30,7 @@ public class EdmTypeImpl extends AbstractEdmNamed implements EdmType { protected final EdmTypeKind kind; public EdmTypeImpl(final Edm edm, final FullQualifiedName typeName, final EdmTypeKind kind, - final Annotatable annotatable) { + final CsdlAnnotatable annotatable) { super(edm, typeName.getName(), annotatable); this.typeName = typeName; this.kind = kind; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java index 1f6ff8e11..767dd1992 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.deserializer.FixedFormatDeserializer; @@ -93,7 +93,7 @@ public abstract class OData { * @param edmProvider a custom or default implementation for creating metadata * @param references list of edmx references */ - public abstract ServiceMetadata createServiceMetadata(EdmProvider edmProvider, List references); + public abstract ServiceMetadata createServiceMetadata(CsdlEdmProvider edmProvider, List references); /** * Creates a new URI helper object for performing URI-related tasks. diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java index e34a28a6f..660db3f2d 100644 --- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java +++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java @@ -33,38 +33,38 @@ import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumMember; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.provider.OnDelete; -import org.apache.olingo.commons.api.edm.provider.OnDeleteAction; -import org.apache.olingo.commons.api.edm.provider.Operation; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; -import org.apache.olingo.commons.api.edm.provider.ReturnType; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete; +import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction; +import org.apache.olingo.commons.api.edm.provider.CsdlOperation; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; /** * This class can convert a CSDL document into EDMProvider object */ public class MetadataParser { - public EdmProvider buildEdmProvider(Reader csdl) throws XMLStreamException { + public CsdlEdmProvider buildEdmProvider(Reader csdl) throws XMLStreamException { XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); XMLEventReader reader = xmlInputFactory.createXMLEventReader(csdl); @@ -112,18 +112,18 @@ public class MetadataParser { private void readSchema(XMLEventReader reader, StartElement element, SchemaBasedEdmProvider provider) throws XMLStreamException { - Schema schema = new Schema(); - schema.setComplexTypes(new ArrayList()); - schema.setActions(new ArrayList()); - schema.setEntityTypes(new ArrayList()); - schema.setEnumTypes(new ArrayList()); - schema.setFunctions(new ArrayList()); - schema.setTerms(new ArrayList()); - schema.setTypeDefinitions(new ArrayList()); + CsdlSchema schema = new CsdlSchema(); + schema.setComplexTypes(new ArrayList()); + schema.setActions(new ArrayList()); + schema.setEntityTypes(new ArrayList()); + schema.setEnumTypes(new ArrayList()); + schema.setFunctions(new ArrayList()); + schema.setTerms(new ArrayList()); + schema.setTypeDefinitions(new ArrayList()); - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, Schema schema, String name) + void build(XMLEventReader reader, StartElement element, CsdlSchema schema, String name) throws XMLStreamException { schema.setNamespace(attr(element, "Namespace")); schema.setAlias(attr(element, "Alias")); @@ -133,10 +133,10 @@ public class MetadataParser { provider.addSchema(schema); } - private void readSchemaContents(XMLEventReader reader, Schema schema) throws XMLStreamException { - new ElementReader() { + private void readSchemaContents(XMLEventReader reader, CsdlSchema schema) throws XMLStreamException { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, Schema schema, String name) + void build(XMLEventReader reader, StartElement element, CsdlSchema schema, String name) throws XMLStreamException { if (name.equals("Action")) { readAction(reader, element, schema); @@ -164,11 +164,11 @@ public class MetadataParser { "EntityContainer", "EntityType", "EnumType", "Function", "Term", "TypeDefinition"); } - private void readAction(XMLEventReader reader, StartElement element, Schema schema) + private void readAction(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { - Action action = new Action(); - action.setParameters(new ArrayList()); + CsdlAction action = new CsdlAction(); + action.setParameters(new ArrayList()); action.setName(attr(element, "Name")); action.setBound(Boolean.parseBoolean(attr(element, "IsBound"))); String entitySetPath = attr(element, "EntitySetPath"); @@ -196,8 +196,8 @@ public class MetadataParser { return false; } - private void readReturnType(StartElement element, Operation operation) { - ReturnType returnType = new ReturnType(); + private void readReturnType(StartElement element, CsdlOperation operation) { + CsdlReturnType returnType = new CsdlReturnType(); returnType.setType(readType(element)); returnType.setCollection(isCollectionType(element)); returnType.setNullable(Boolean.parseBoolean(attr(element, "Nullable"))); @@ -221,8 +221,8 @@ public class MetadataParser { operation.setReturnType(returnType); } - private void readParameter(StartElement element, Operation operation) { - Parameter parameter = new Parameter(); + private void readParameter(StartElement element, CsdlOperation operation) { + CsdlParameter parameter = new CsdlParameter(); parameter.setName(attr(element, "Name")); parameter.setType(readType(element)); parameter.setCollection(isCollectionType(element)); @@ -247,8 +247,8 @@ public class MetadataParser { operation.getParameters().add(parameter); } - private TypeDefinition readTypeDefinition(StartElement element) { - TypeDefinition td = new TypeDefinition(); + private CsdlTypeDefinition readTypeDefinition(StartElement element) { + CsdlTypeDefinition td = new CsdlTypeDefinition(); td.setName(attr(element, "Name")); td.setUnderlyingType(new FullQualifiedName(attr(element, "UnderlyingType"))); td.setUnicode(Boolean.parseBoolean(attr(element, "Unicode"))); @@ -272,8 +272,8 @@ public class MetadataParser { return td; } - private Term readTerm(StartElement element) { - Term term = new Term(); + private CsdlTerm readTerm(StartElement element) { + CsdlTerm term = new CsdlTerm(); term.setName(attr(element, "Name")); term.setType(attr(element, "Type")); if (attr(element, "BaseTerm") != null) { @@ -305,10 +305,10 @@ public class MetadataParser { return term; } - private void readFunction(XMLEventReader reader, StartElement element, Schema schema) + private void readFunction(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { - Function function = new Function(); - function.setParameters(new ArrayList()); + CsdlFunction function = new CsdlFunction(); + function.setParameters(new ArrayList()); function.setName(attr(element, "Name")); function.setBound(Boolean.parseBoolean(attr(element, "IsBound"))); function.setComposable(Boolean.parseBoolean(attr(element, "IsComposable"))); @@ -321,11 +321,11 @@ public class MetadataParser { schema.getFunctions().add(function); } - private void readOperationParameters(XMLEventReader reader, final Operation operation) + private void readOperationParameters(XMLEventReader reader, final CsdlOperation operation) throws XMLStreamException { - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, Operation operation, String name) + void build(XMLEventReader reader, StartElement element, CsdlOperation operation, String name) throws XMLStreamException { if (name.equals("Parameter")) { readParameter(element, operation); @@ -336,10 +336,10 @@ public class MetadataParser { }.read(reader, null, operation, "Parameter", "ReturnType"); } - private void readEnumType(XMLEventReader reader, StartElement element, Schema schema) + private void readEnumType(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { - EnumType type = new EnumType(); - type.setMembers(new ArrayList()); + CsdlEnumType type = new CsdlEnumType(); + type.setMembers(new ArrayList()); type.setName(attr(element, "Name")); if (attr(element, "UnderlyingType") != null) { type.setUnderlyingType(new FullQualifiedName(attr(element, "UnderlyingType"))); @@ -350,13 +350,13 @@ public class MetadataParser { schema.getEnumTypes().add(type); } - private void readEnumMembers(XMLEventReader reader, StartElement element, EnumType type) + private void readEnumMembers(XMLEventReader reader, StartElement element, CsdlEnumType type) throws XMLStreamException { - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, EnumType type, String name) + void build(XMLEventReader reader, StartElement element, CsdlEnumType type, String name) throws XMLStreamException { - EnumMember member = new EnumMember(); + CsdlEnumMember member = new CsdlEnumMember(); member.setName(attr(element, "Name")); member.setValue(attr(element, "Value")); type.getMembers().add(member); @@ -364,12 +364,12 @@ public class MetadataParser { }.read(reader, element, type, "Member"); } - private void readEntityType(XMLEventReader reader, StartElement element, Schema schema) + private void readEntityType(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { - EntityType entityType = new EntityType(); - entityType.setProperties(new ArrayList()); - entityType.setNavigationProperties(new ArrayList()); - entityType.setKey(new ArrayList()); + CsdlEntityType entityType = new CsdlEntityType(); + entityType.setProperties(new ArrayList()); + entityType.setNavigationProperties(new ArrayList()); + entityType.setKey(new ArrayList()); entityType.setName(attr(element, "Name")); if (attr(element, "BaseType") != null) { entityType.setBaseType(new FullQualifiedName(attr(element, "BaseType"))); @@ -381,11 +381,11 @@ public class MetadataParser { schema.getEntityTypes().add(entityType); } - private void readEntityProperties(XMLEventReader reader, EntityType entityType) + private void readEntityProperties(XMLEventReader reader, CsdlEntityType entityType) throws XMLStreamException { - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, EntityType entityType, String name) + void build(XMLEventReader reader, StartElement element, CsdlEntityType entityType, String name) throws XMLStreamException { if (name.equals("Property")) { entityType.getProperties().add(readProperty(element)); @@ -398,13 +398,13 @@ public class MetadataParser { }.read(reader, null, entityType, "Property", "NavigationProperty", "Key"); } - private void readKey(XMLEventReader reader, StartElement element, EntityType entityType) + private void readKey(XMLEventReader reader, StartElement element, CsdlEntityType entityType) throws XMLStreamException { - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, EntityType entityType, String name) + void build(XMLEventReader reader, StartElement element, CsdlEntityType entityType, String name) throws XMLStreamException { - PropertyRef ref = new PropertyRef(); + CsdlPropertyRef ref = new CsdlPropertyRef(); ref.setName(attr(element, "Name")); ref.setAlias(attr(element, "Alias")); entityType.getKey().add(ref); @@ -412,10 +412,10 @@ public class MetadataParser { }.read(reader, element, entityType, "PropertyRef"); } - private NavigationProperty readNavigationProperty(XMLEventReader reader, StartElement element) + private CsdlNavigationProperty readNavigationProperty(XMLEventReader reader, StartElement element) throws XMLStreamException { - NavigationProperty property = new NavigationProperty(); - property.setReferentialConstraints(new ArrayList()); + CsdlNavigationProperty property = new CsdlNavigationProperty(); + property.setReferentialConstraints(new ArrayList()); property.setName(attr(element, "Name")); property.setType(readType(element)); @@ -424,17 +424,17 @@ public class MetadataParser { property.setPartner(attr(element, "Partner")); property.setContainsTarget(Boolean.parseBoolean(attr(element, "ContainsTarget"))); - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, NavigationProperty property, + void build(XMLEventReader reader, StartElement element, CsdlNavigationProperty property, String name) throws XMLStreamException { if (name.equals("ReferentialConstraint")) { - ReferentialConstraint constraint = new ReferentialConstraint(); + CsdlReferentialConstraint constraint = new CsdlReferentialConstraint(); constraint.setProperty(attr(element, "Property")); constraint.setReferencedProperty(attr(element, "ReferencedProperty")); property.getReferentialConstraints().add(constraint); } else if (name.equals("OnDelete")) { - property.setOnDelete(new OnDelete().setAction(OnDeleteAction.valueOf(attr(element, "Action")))); + property.setOnDelete(new CsdlOnDelete().setAction(CsdlOnDeleteAction.valueOf(attr(element, "Action")))); } } }.read(reader, element, property, "ReferentialConstraint", "OnDelete"); @@ -449,8 +449,8 @@ public class MetadataParser { return null; } - private Property readProperty(StartElement element) { - Property property = new Property(); + private CsdlProperty readProperty(StartElement element) { + CsdlProperty property = new CsdlProperty(); property.setName(attr(element, "Name")); property.setType(readType(element)); property.setCollection(isCollectionType(element)); @@ -481,21 +481,21 @@ public class MetadataParser { return property; } - private void readEntityContainer(XMLEventReader reader, StartElement element, Schema schema) + private void readEntityContainer(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { - final EntityContainer container = new EntityContainer(); + final CsdlEntityContainer container = new CsdlEntityContainer(); container.setName(attr(element, "Name")); if (attr(element, "Extends") != null) { container.setExtendsContainer(attr(element, "Extends")); } - container.setActionImports(new ArrayList()); - container.setFunctionImports(new ArrayList()); - container.setEntitySets(new ArrayList()); - container.setSingletons(new ArrayList()); + container.setActionImports(new ArrayList()); + container.setFunctionImports(new ArrayList()); + container.setEntitySets(new ArrayList()); + container.setSingletons(new ArrayList()); - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, Schema schema, String name) + void build(XMLEventReader reader, StartElement element, CsdlSchema schema, String name) throws XMLStreamException { if (name.equals("EntitySet")) { readEntitySet(reader, element, container); @@ -508,8 +508,8 @@ public class MetadataParser { } } - private void readFunctionImport(StartElement element, EntityContainer container) { - FunctionImport functionImport = new FunctionImport(); + private void readFunctionImport(StartElement element, CsdlEntityContainer container) { + CsdlFunctionImport functionImport = new CsdlFunctionImport(); functionImport.setName(attr(element, "Name")); functionImport.setFunction(new FullQualifiedName(attr(element, "Function"))); functionImport.setIncludeInServiceDocument(Boolean.parseBoolean(attr(element, @@ -522,8 +522,8 @@ public class MetadataParser { container.getFunctionImports().add(functionImport); } - private void readActionImport(StartElement element, EntityContainer container) { - ActionImport actionImport = new ActionImport(); + private void readActionImport(StartElement element, CsdlEntityContainer container) { + CsdlActionImport actionImport = new CsdlActionImport(); actionImport.setName(attr(element, "Name")); actionImport.setAction(new FullQualifiedName(attr(element, "Action"))); @@ -535,35 +535,35 @@ public class MetadataParser { } private void readSingleton(XMLEventReader reader, StartElement element, - EntityContainer container) throws XMLStreamException { - Singleton singleton = new Singleton(); - singleton.setNavigationPropertyBindings(new ArrayList()); + CsdlEntityContainer container) throws XMLStreamException { + CsdlSingleton singleton = new CsdlSingleton(); + singleton.setNavigationPropertyBindings(new ArrayList()); singleton.setName(attr(element, "Name")); singleton.setType(new FullQualifiedName(attr(element, "Type"))); - singleton.setNavigationPropertyBindings(new ArrayList()); + singleton.setNavigationPropertyBindings(new ArrayList()); readNavigationPropertyBindings(reader, element, singleton.getNavigationPropertyBindings()); container.getSingletons().add(singleton); } private void readEntitySet(XMLEventReader reader, StartElement element, - EntityContainer container) throws XMLStreamException { - EntitySet entitySet = new EntitySet(); + CsdlEntityContainer container) throws XMLStreamException { + CsdlEntitySet entitySet = new CsdlEntitySet(); entitySet.setName(attr(element, "Name")); entitySet.setType(new FullQualifiedName(attr(element, "EntityType"))); entitySet.setIncludeInServiceDocument(Boolean.parseBoolean(attr(element, "IncludeInServiceDocument"))); - entitySet.setNavigationPropertyBindings(new ArrayList()); + entitySet.setNavigationPropertyBindings(new ArrayList()); readNavigationPropertyBindings(reader, element, entitySet.getNavigationPropertyBindings()); container.getEntitySets().add(entitySet); } private void readNavigationPropertyBindings(XMLEventReader reader, StartElement element, - List bindings) throws XMLStreamException { - new ElementReader>() { + List bindings) throws XMLStreamException { + new ElementReader>() { @Override void build(XMLEventReader reader, StartElement element, - List bindings, String name) throws XMLStreamException { - NavigationPropertyBinding binding = new NavigationPropertyBinding(); + List bindings, String name) throws XMLStreamException { + CsdlNavigationPropertyBinding binding = new CsdlNavigationPropertyBinding(); binding.setPath(attr(element, "Path")); binding.setTarget(attr(element, "Target")); bindings.add(binding); @@ -576,11 +576,11 @@ public class MetadataParser { schema.setEntityContainer(container); } - private void readComplexType(XMLEventReader reader, StartElement element, Schema schema) + private void readComplexType(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { - ComplexType complexType = new ComplexType(); - complexType.setProperties(new ArrayList()); - complexType.setNavigationProperties(new ArrayList()); + CsdlComplexType complexType = new CsdlComplexType(); + complexType.setProperties(new ArrayList()); + complexType.setNavigationProperties(new ArrayList()); complexType.setName(attr(element, "Name")); if (attr(element, "BaseType") != null) { complexType.setBaseType(new FullQualifiedName(attr(element, "BaseType"))); @@ -592,11 +592,11 @@ public class MetadataParser { schema.getComplexTypes().add(complexType); } - private void readProperties(XMLEventReader reader, ComplexType complexType) + private void readProperties(XMLEventReader reader, CsdlComplexType complexType) throws XMLStreamException { - new ElementReader() { + new ElementReader() { @Override - void build(XMLEventReader reader, StartElement element, ComplexType complexType, String name) + void build(XMLEventReader reader, StartElement element, CsdlComplexType complexType, String name) throws XMLStreamException { if (name.equals("Property")) { complexType.getProperties().add(readProperty(element)); diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java index cc811c03c..a35f3bcf6 100644 --- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java +++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java @@ -24,34 +24,34 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; -public class SchemaBasedEdmProvider implements EdmProvider { - private final List edmSchemas = new ArrayList(); +public class SchemaBasedEdmProvider implements CsdlEdmProvider { + private final List edmSchemas = new ArrayList(); - public void addSchema(Schema schema) { + public void addSchema(CsdlSchema schema) { this.edmSchemas.add(schema); } - private Schema getSchema(String ns) { - for (Schema s : this.edmSchemas) { + private CsdlSchema getSchema(String ns) { + for (CsdlSchema s : this.edmSchemas) { if (s.getNamespace().equals(ns)) { return s; } @@ -60,12 +60,12 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public EnumType getEnumType(FullQualifiedName fqn) throws ODataException { - Schema schema = getSchema(fqn.getNamespace()); + public CsdlEnumType getEnumType(FullQualifiedName fqn) throws ODataException { + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { - List types = schema.getEnumTypes(); + List types = schema.getEnumTypes(); if (types != null) { - for (EnumType type : types) { + for (CsdlEnumType type : types) { if (type.getName().equals(fqn.getName())) { return type; } @@ -76,12 +76,12 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public TypeDefinition getTypeDefinition(FullQualifiedName fqn) throws ODataException { - Schema schema = getSchema(fqn.getNamespace()); + public CsdlTypeDefinition getTypeDefinition(FullQualifiedName fqn) throws ODataException { + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { - List types = schema.getTypeDefinitions(); + List types = schema.getTypeDefinitions(); if (types != null) { - for (TypeDefinition type : types) { + for (CsdlTypeDefinition type : types) { if (type.getName().equals(fqn.getName())) { return type; } @@ -92,13 +92,13 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public List getFunctions(FullQualifiedName fqn) throws ODataException { - ArrayList foundFuncs = new ArrayList(); - Schema schema = getSchema(fqn.getNamespace()); + public List getFunctions(FullQualifiedName fqn) throws ODataException { + ArrayList foundFuncs = new ArrayList(); + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { - List functions = schema.getFunctions(); + List functions = schema.getFunctions(); if (functions != null) { - for (Function func : functions) { + for (CsdlFunction func : functions) { if (func.getName().equals(fqn.getName())) { foundFuncs.add(func); } @@ -109,12 +109,12 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public Term getTerm(FullQualifiedName fqn) throws ODataException { - Schema schema = getSchema(fqn.getNamespace()); + public CsdlTerm getTerm(FullQualifiedName fqn) throws ODataException { + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { - List terms = schema.getTerms(); + List terms = schema.getTerms(); if (terms != null) { - for (Term term : terms) { + for (CsdlTerm term : terms) { if (term.getName().equals(fqn.getName())) { return term; } @@ -125,12 +125,12 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public EntitySet getEntitySet(FullQualifiedName fqn, String entitySetName) throws ODataException { - Schema schema = getSchema(fqn.getFullQualifiedNameAsString()); + public CsdlEntitySet getEntitySet(FullQualifiedName fqn, String entitySetName) throws ODataException { + CsdlSchema schema = getSchema(fqn.getFullQualifiedNameAsString()); if (schema != null) { - EntityContainer ec = schema.getEntityContainer(); + CsdlEntityContainer ec = schema.getEntityContainer(); if (ec != null && ec.getEntitySets() != null) { - for (EntitySet es : ec.getEntitySets()) { + for (CsdlEntitySet es : ec.getEntitySets()) { if (es.getName().equals(entitySetName)) { return es; } @@ -141,12 +141,12 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public Singleton getSingleton(FullQualifiedName fqn, String singletonName) throws ODataException { - Schema schema = getSchema(fqn.getFullQualifiedNameAsString()); + public CsdlSingleton getSingleton(FullQualifiedName fqn, String singletonName) throws ODataException { + CsdlSchema schema = getSchema(fqn.getFullQualifiedNameAsString()); if (schema != null) { - EntityContainer ec = schema.getEntityContainer(); + CsdlEntityContainer ec = schema.getEntityContainer(); if (ec != null && ec.getSingletons() != null) { - for (Singleton es : ec.getSingletons()) { + for (CsdlSingleton es : ec.getSingletons()) { if (es.getName().equals(singletonName)) { return es; } @@ -157,13 +157,13 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public ActionImport getActionImport(FullQualifiedName fqn, String actionImportName) + public CsdlActionImport getActionImport(FullQualifiedName fqn, String actionImportName) throws ODataException { - Schema schema = getSchema(fqn.getFullQualifiedNameAsString()); + CsdlSchema schema = getSchema(fqn.getFullQualifiedNameAsString()); if (schema != null) { - EntityContainer ec = schema.getEntityContainer(); + CsdlEntityContainer ec = schema.getEntityContainer(); if (ec != null && ec.getActionImports() != null) { - for (ActionImport es : ec.getActionImports()) { + for (CsdlActionImport es : ec.getActionImports()) { if (es.getName().equals(actionImportName)) { return es; } @@ -174,13 +174,13 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public FunctionImport getFunctionImport(FullQualifiedName fqn, String functionImportName) + public CsdlFunctionImport getFunctionImport(FullQualifiedName fqn, String functionImportName) throws ODataException { - Schema schema = getSchema(fqn.getFullQualifiedNameAsString()); + CsdlSchema schema = getSchema(fqn.getFullQualifiedNameAsString()); if (schema != null) { - EntityContainer ec = schema.getEntityContainer(); + CsdlEntityContainer ec = schema.getEntityContainer(); if (ec != null && ec.getFunctionImports() != null) { - for (FunctionImport es : ec.getFunctionImports()) { + for (CsdlFunctionImport es : ec.getFunctionImports()) { if (es.getName().equals(functionImportName)) { return es; } @@ -191,11 +191,11 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public EntityContainerInfo getEntityContainerInfo(FullQualifiedName fqn) throws ODataException { - Schema schema = null; + public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName fqn) throws ODataException { + CsdlSchema schema = null; if (fqn == null) { - for (Schema s : this.edmSchemas) { + for (CsdlSchema s : this.edmSchemas) { if (s.getEntityContainer() != null) { schema = s; break; @@ -206,9 +206,9 @@ public class SchemaBasedEdmProvider implements EdmProvider { } if (schema != null) { - EntityContainer ec = schema.getEntityContainer(); + CsdlEntityContainer ec = schema.getEntityContainer(); if (ec != null) { - EntityContainerInfo info = new EntityContainerInfo(); + CsdlEntityContainerInfo info = new CsdlEntityContainerInfo(); info.setContainerName(new FullQualifiedName(schema.getNamespace())); if (schema.getEntityContainer().getExtendsContainer() != null) { info.setExtendsContainer(new FullQualifiedName(schema.getEntityContainer().getExtendsContainer())); @@ -220,9 +220,9 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public List getAliasInfos() throws ODataException { - Schema schema = null; - for (Schema s : this.edmSchemas) { + public List getAliasInfos() throws ODataException { + CsdlSchema schema = null; + for (CsdlSchema s : this.edmSchemas) { if (s.getEntityContainer() != null) { schema = s; break; @@ -233,17 +233,17 @@ public class SchemaBasedEdmProvider implements EdmProvider { schema = this.edmSchemas.get(0); } - AliasInfo ai = new AliasInfo(); + CsdlAliasInfo ai = new CsdlAliasInfo(); ai.setAlias(schema.getAlias()); ai.setNamespace(schema.getNamespace()); return Arrays.asList(ai); } @Override - public EntityContainer getEntityContainer() throws ODataException { + public CsdlEntityContainer getEntityContainer() throws ODataException { // note that there can be many schemas, but only one needs to contain the // entity container in a given metadata document. - for (Schema s : this.edmSchemas) { + for (CsdlSchema s : this.edmSchemas) { if (s.getEntityContainer() != null) { return s.getEntityContainer(); } @@ -252,16 +252,16 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public List getSchemas() throws ODataException { - return new ArrayList(this.edmSchemas); + public List getSchemas() throws ODataException { + return new ArrayList(this.edmSchemas); } @Override - public EntityType getEntityType(final FullQualifiedName fqn) throws ODataException { - Schema schema = getSchema(fqn.getNamespace()); + public CsdlEntityType getEntityType(final FullQualifiedName fqn) throws ODataException { + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { if (schema.getEntityTypes() != null) { - for (EntityType type : schema.getEntityTypes()) { + for (CsdlEntityType type : schema.getEntityTypes()) { if (type.getName().equals(fqn.getName())) { return type; } @@ -272,11 +272,11 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public ComplexType getComplexType(final FullQualifiedName fqn) throws ODataException { - Schema schema = getSchema(fqn.getNamespace()); + public CsdlComplexType getComplexType(final FullQualifiedName fqn) throws ODataException { + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { if (schema.getComplexTypes() != null) { - for (ComplexType type : schema.getComplexTypes()) { + for (CsdlComplexType type : schema.getComplexTypes()) { if (type.getName().equals(fqn.getName())) { return type; } @@ -287,13 +287,13 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public List getActions(final FullQualifiedName fqn) throws ODataException { - ArrayList actions = new ArrayList(); - Schema schema = getSchema(fqn.getNamespace()); + public List getActions(final FullQualifiedName fqn) throws ODataException { + ArrayList actions = new ArrayList(); + CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { - List types = schema.getActions(); + List types = schema.getActions(); if (types != null) { - for (Action type : types) { + for (CsdlAction type : types) { if (type.getName().equals(fqn.getName())) { actions.add(type); } @@ -304,12 +304,12 @@ public class SchemaBasedEdmProvider implements EdmProvider { } @Override - public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { + public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { return null; } @Override - public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { + public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { return null; } } diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java index 9749a6cc5..10502ad6b 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java @@ -29,19 +29,19 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; import org.junit.Before; import org.junit.Test; @@ -49,7 +49,7 @@ public class MetadataParserTest { final String NS = "Microsoft.OData.SampleService.Models.TripPin"; final FullQualifiedName NSF = new FullQualifiedName(NS); - EdmProvider provider = null; + CsdlEdmProvider provider = null; @Before public void setUp() throws Exception { @@ -60,7 +60,7 @@ public class MetadataParserTest { @Test public void testAction() throws ODataException { // test action - List actions = provider.getActions(new FullQualifiedName(NS, "ResetDataSource")); + List actions = provider.getActions(new FullQualifiedName(NS, "ResetDataSource")); assertNotNull(actions); assertEquals(1, actions.size()); } @@ -68,7 +68,7 @@ public class MetadataParserTest { @Test public void testFunction() throws ODataException { // test function - List functions = provider + List functions = provider .getFunctions(new FullQualifiedName(NS, "GetFavoriteAirline")); assertNotNull(functions); assertEquals(1, functions.size()); @@ -79,7 +79,7 @@ public class MetadataParserTest { "person/Trips/PlanItems/Microsoft.OData.SampleService.Models.TripPin.Flight/Airline", functions.get(0).getEntitySetPath()); - List parameters = functions.get(0).getParameters(); + List parameters = functions.get(0).getParameters(); assertNotNull(parameters); assertEquals(1, parameters.size()); assertEquals("person", parameters.get(0).getName()); @@ -95,7 +95,7 @@ public class MetadataParserTest { @Test public void testEnumType() throws ODataException { // test enum type - EnumType enumType = provider.getEnumType(new FullQualifiedName(NS, "PersonGender")); + CsdlEnumType enumType = provider.getEnumType(new FullQualifiedName(NS, "PersonGender")); assertNotNull(enumType); assertEquals("Male", enumType.getMembers().get(0).getName()); assertEquals("Female", enumType.getMembers().get(1).getName()); @@ -108,7 +108,7 @@ public class MetadataParserTest { @Test public void testEntityType() throws ODataException { // test Entity Type - EntityType et = provider.getEntityType(new FullQualifiedName(NS, "Photo")); + CsdlEntityType et = provider.getEntityType(new FullQualifiedName(NS, "Photo")); assertNotNull(et); assertNotNull(et.getKey()); assertEquals("Id", et.getKey().get(0).getName()); @@ -122,10 +122,10 @@ public class MetadataParserTest { @Test public void testComplexType() throws ODataException { // Test Complex Type - ComplexType ct = provider.getComplexType(new FullQualifiedName(NS, "City")); + CsdlComplexType ct = provider.getComplexType(new FullQualifiedName(NS, "City")); assertNotNull(ct); assertEquals(3, ct.getProperties().size()); - Property p = ct.getProperties().get(0); + CsdlProperty p = ct.getProperties().get(0); assertEquals("CountryRegion", p.getName()); assertEquals("Edm.String", p.getType()); assertEquals(false, p.isNullable()); @@ -139,11 +139,11 @@ public class MetadataParserTest { @Test public void testEntitySet() throws Exception { - EntitySet es = provider.getEntitySet(NSF, "People"); + CsdlEntitySet es = provider.getEntitySet(NSF, "People"); assertNotNull(es); assertEquals("Microsoft.OData.SampleService.Models.TripPin.Person",es.getType()); - List bindings = es.getNavigationPropertyBindings(); + List bindings = es.getNavigationPropertyBindings(); assertNotNull(bindings); assertEquals(6, bindings.size()); assertEquals("Microsoft.OData.SampleService.Models.TripPin.Flight/From", bindings.get(2) @@ -153,7 +153,7 @@ public class MetadataParserTest { @Test public void testFunctionImport() throws Exception { - FunctionImport fi = provider.getFunctionImport(NSF, "GetNearestAirport"); + CsdlFunctionImport fi = provider.getFunctionImport(NSF, "GetNearestAirport"); assertNotNull(fi); assertEquals("Microsoft.OData.SampleService.Models.TripPin.GetNearestAirport", fi.getFunction()); assertEquals("Airports", fi.getEntitySet()); @@ -162,7 +162,7 @@ public class MetadataParserTest { @Test public void testActionImport() throws Exception { - ActionImport ai = provider.getActionImport(NSF, "ResetDataSource"); + CsdlActionImport ai = provider.getActionImport(NSF, "ResetDataSource"); assertNotNull(ai); assertEquals("Microsoft.OData.SampleService.Models.TripPin.ResetDataSource", ai.getAction()); assertNull(ai.getEntitySet()); @@ -170,12 +170,12 @@ public class MetadataParserTest { @Test public void testSingleton() throws Exception { - Singleton single = this.provider.getSingleton(NSF, "Me"); + CsdlSingleton single = this.provider.getSingleton(NSF, "Me"); assertNotNull(single); assertEquals("Microsoft.OData.SampleService.Models.TripPin.Person",single.getType()); - List bindings = single.getNavigationPropertyBindings(); + List bindings = single.getNavigationPropertyBindings(); assertNotNull(bindings); assertEquals(6, bindings.size()); assertEquals("Microsoft.OData.SampleService.Models.TripPin.Flight/From", bindings.get(2).getPath()); diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java index 6156c1b39..62f91fb58 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java @@ -41,7 +41,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; import org.apache.olingo.commons.api.http.HttpMethod; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; @@ -70,9 +70,9 @@ public class ServiceDispatcherTest { public class SampleODataServlet extends HttpServlet { private final ServiceHandler handler; // must be stateless - private final EdmProvider provider; // must be stateless + private final CsdlEdmProvider provider; // must be stateless - public SampleODataServlet(ServiceHandler handler, EdmProvider provider) { + public SampleODataServlet(ServiceHandler handler, CsdlEdmProvider provider) { this.handler = handler; this.provider = provider; } @@ -92,7 +92,7 @@ public class ServiceDispatcherTest { public void beforeTest(ServiceHandler serviceHandler) throws Exception { MetadataParser parser = new MetadataParser(); - EdmProvider edmProvider = parser.buildEdmProvider(new FileReader( + CsdlEdmProvider edmProvider = parser.buildEdmProvider(new FileReader( "src/test/resources/trippin.xml")); File baseDir = new File(System.getProperty("java.io.tmpdir")); diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java index 94295cda2..fbc74ef3c 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java @@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.stream.XMLStreamException; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; import org.apache.olingo.server.api.ServiceMetadata; @@ -50,7 +50,7 @@ public class TripPinServlet extends HttpServlet { public void service(HttpServletRequest request, HttpServletResponse response) throws IOException { OData odata = OData4Impl.newInstance(); MetadataParser parser = new MetadataParser(); - EdmProvider edmProvider = null; + CsdlEdmProvider edmProvider = null; try { edmProvider = parser.buildEdmProvider(new FileReader("src/test/resources/trippin.xml")); diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java index 80bed2fd5..29931a228 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java @@ -22,7 +22,7 @@ import java.util.List; import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.apache.olingo.server.api.OData; @@ -76,7 +76,7 @@ public class ODataImpl extends OData { } @Override - public ServiceMetadata createServiceMetadata(EdmProvider edmProvider, List references) { + public ServiceMetadata createServiceMetadata(CsdlEdmProvider edmProvider, List references) { return new ServiceMetadataImpl(edmProvider, references); } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java index ad8cbc450..86d6e5a90 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java @@ -20,7 +20,7 @@ package org.apache.olingo.server.core; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.api.ServiceMetadata; @@ -36,7 +36,7 @@ public class ServiceMetadataImpl implements ServiceMetadata { private final EdmProviderImpl edm; private final List references = new ArrayList(); - public ServiceMetadataImpl(EdmProvider edmProvider, List references) { + public ServiceMetadataImpl(CsdlEdmProvider edmProvider, List references) { this.edm = new EdmProviderImpl(edmProvider); this.references.addAll(references); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/AbstractEdmNamedTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/AbstractEdmNamedTest.java index efc75b772..14919b7fe 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/AbstractEdmNamedTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/AbstractEdmNamedTest.java @@ -20,8 +20,8 @@ package org.apache.olingo.server.core.edm.provider; import org.apache.olingo.commons.api.edm.EdmAnnotatable; import org.apache.olingo.commons.api.edm.EdmNamed; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; import org.apache.olingo.commons.core.edm.AbstractEdmNamed; import org.junit.Test; @@ -48,10 +48,10 @@ public class AbstractEdmNamedTest { } } - private class AnnoTester implements Annotatable { + private class AnnoTester implements CsdlAnnotatable { @Override - public List getAnnotations() { - Annotation annotation = new Annotation(); + public List getAnnotations() { + CsdlAnnotation annotation = new CsdlAnnotation(); annotation.setTerm("NS.SimpleTerm"); return Arrays.asList(annotation); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java index a33fc6e38..86bd9f464 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java @@ -37,9 +37,9 @@ import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; import org.apache.olingo.commons.core.edm.EdmActionImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; @@ -54,21 +54,21 @@ public class EdmActionImplTest { @Before public void setup() { EdmProviderImpl provider = mock(EdmProviderImpl.class); - List parameters = new ArrayList(); - parameters.add(new Parameter().setName("Id").setType(new FullQualifiedName("namespace", "name"))); + List parameters = new ArrayList(); + parameters.add(new CsdlParameter().setName("Id").setType(new FullQualifiedName("namespace", "name"))); FullQualifiedName action1Name = new FullQualifiedName("namespace", "action1"); - Action action1 = new Action().setName("action1").setBound(true).setParameters(parameters); + CsdlAction action1 = new CsdlAction().setName("action1").setBound(true).setParameters(parameters); actionImpl1 = new EdmActionImpl(provider, action1Name, action1); FullQualifiedName action2Name = new FullQualifiedName("namespace", "action2"); FullQualifiedName returnTypeName = new FullQualifiedName("Edm", "String"); - ReturnType returnType = new ReturnType().setType(returnTypeName); - Action action2 = new Action().setName("action2").setParameters(parameters).setReturnType(returnType); + CsdlReturnType returnType = new CsdlReturnType().setType(returnTypeName); + CsdlAction action2 = new CsdlAction().setName("action2").setParameters(parameters).setReturnType(returnType); actionImpl2 = new EdmActionImpl(provider, action2Name, action2); FullQualifiedName action3Name = new FullQualifiedName("namespace", "action3"); - Action action3 = - new Action().setName("action3").setParameters(parameters).setReturnType(returnType).setEntitySetPath( + CsdlAction action3 = + new CsdlAction().setName("action3").setParameters(parameters).setReturnType(returnType).setEntitySetPath( "path/Id"); actionImpl3 = new EdmActionImpl(provider, action3Name, action3); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java index a5d098dcd..02824f433 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java @@ -30,7 +30,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; import org.apache.olingo.commons.core.edm.EdmActionImportImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; @@ -51,8 +51,8 @@ public class EdmActionImportImplTest { FullQualifiedName actionFqn = new FullQualifiedName("namespace", "actionName"); FullQualifiedName entityContainerFqn = new FullQualifiedName("namespace", "containerName"); String target = entityContainerFqn.getFullQualifiedNameAsString() + "/entitySetName"; - ActionImport providerActionImport = - new ActionImport().setName("actionImportName").setAction(actionFqn).setEntitySet(target); + CsdlActionImport providerActionImport = + new CsdlActionImport().setName("actionImportName").setAction(actionFqn).setEntitySet(target); EdmProviderImpl edm = mock(EdmProviderImpl.class); container = mock(EdmEntityContainer.class); @@ -85,7 +85,7 @@ public class EdmActionImportImplTest { @Test(expected = EdmException.class) public void getReturnedEntitySetNonExistingContainer() { String target = "alias.nonexisting/Es"; - ActionImport providerActionImport = new ActionImport().setName("actionImportName").setEntitySet(target); + CsdlActionImport providerActionImport = new CsdlActionImport().setName("actionImportName").setEntitySet(target); EdmActionImport actionImport = new EdmActionImportImpl(mock(EdmProviderImpl.class), container, providerActionImport); actionImport.getReturnedEntitySet(); @@ -94,7 +94,7 @@ public class EdmActionImportImplTest { @Test(expected = EdmException.class) public void getReturnedEntitySetNonExistingEntitySet() { String target = "nonExisting"; - ActionImport providerActionImport = new ActionImport().setName("actionImportName").setEntitySet(target); + CsdlActionImport providerActionImport = new CsdlActionImport().setName("actionImportName").setEntitySet(target); EdmProviderImpl edm = mock(EdmProviderImpl.class); when(edm.getEntityContainer(null)).thenReturn(container); EdmActionImport actionImport = new EdmActionImportImpl(edm, container, providerActionImport); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java index 87a7723f1..71b8d2b42 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java @@ -23,10 +23,10 @@ import org.apache.olingo.commons.api.edm.EdmElement; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; import org.apache.olingo.commons.core.edm.EdmComplexTypeImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; @@ -51,16 +51,16 @@ public class EdmComplexTypeImplTest { @Before public void setupTypes() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); - ComplexType baseComplexType = new ComplexType(); - List baseProperties = new ArrayList(); - baseProperties.add(new Property().setName("prop1").setType( + CsdlComplexType baseComplexType = new CsdlComplexType(); + List baseProperties = new ArrayList(); + baseProperties.add(new CsdlProperty().setName("prop1").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - List baseNavigationProperties = new ArrayList(); - baseNavigationProperties.add(new NavigationProperty().setName("nav1")); + List baseNavigationProperties = new ArrayList(); + baseNavigationProperties.add(new CsdlNavigationProperty().setName("nav1")); baseComplexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(baseProperties) .setNavigationProperties(baseNavigationProperties); when(provider.getComplexType(baseName)).thenReturn(baseComplexType); @@ -68,11 +68,11 @@ public class EdmComplexTypeImplTest { baseType = new EdmComplexTypeImpl(edm, baseName, baseComplexType); FullQualifiedName name = new FullQualifiedName("namespace", "typeName"); - ComplexType complexType = new ComplexType().setBaseType(baseName); - List properties = new ArrayList(); - properties.add(new Property().setName("prop2").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("nav2")); + CsdlComplexType complexType = new CsdlComplexType().setBaseType(baseName); + List properties = new ArrayList(); + properties.add(new CsdlProperty().setName("prop2").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("nav2")); complexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(properties) .setNavigationProperties(navigationProperties); when(provider.getComplexType(name)).thenReturn(complexType); @@ -83,7 +83,7 @@ public class EdmComplexTypeImplTest { @Test public void noPropertiesAndNoNavPropertiesMustNotResultInException() { EdmProviderImpl edm = mock(EdmProviderImpl.class); - ComplexType complexType = new ComplexType().setName("n"); + CsdlComplexType complexType = new CsdlComplexType().setName("n"); new EdmComplexTypeImpl(edm, new FullQualifiedName("n", "n"), complexType); } @@ -155,11 +155,11 @@ public class EdmComplexTypeImplTest { @Test(expected = EdmException.class) public void nonExistingBaseType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName typeWithNonexistingBaseTypeName = new FullQualifiedName("namespace", "typeName"); - ComplexType complexTypeForNonexistingBaseType = - new ComplexType().setBaseType(new FullQualifiedName("wrong", "wrong")); + CsdlComplexType complexTypeForNonexistingBaseType = + new CsdlComplexType().setBaseType(new FullQualifiedName("wrong", "wrong")); complexTypeForNonexistingBaseType.setName("typeName"); when(provider.getComplexType(typeWithNonexistingBaseTypeName)).thenReturn(complexTypeForNonexistingBaseType); EdmComplexTypeImpl instance = diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java index 52713a3b1..471972f69 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java @@ -37,14 +37,14 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; import org.apache.olingo.commons.core.edm.EdmEntityContainerImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; @@ -56,10 +56,10 @@ public class EdmEntityContainerImplTest { @Before public void setup() { - EdmProvider provider = new CustomProvider(); + CsdlEdmProvider provider = new CustomProvider(); EdmProviderImpl edm = new EdmProviderImpl(provider); - EntityContainerInfo entityContainerInfo = - new EntityContainerInfo().setContainerName(new FullQualifiedName("space", "name")); + CsdlEntityContainerInfo entityContainerInfo = + new CsdlEntityContainerInfo().setContainerName(new FullQualifiedName("space", "name")); container = new EdmEntityContainerImpl(edm, provider, entityContainerInfo); } @@ -125,15 +125,15 @@ public class EdmEntityContainerImplTest { @Test public void checkEdmExceptionConversion() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); FullQualifiedName containerName = new FullQualifiedName("space", "name"); when(provider.getEntitySet(containerName, null)).thenThrow(new ODataException("msg")); when(provider.getSingleton(containerName, null)).thenThrow(new ODataException("msg")); when(provider.getFunctionImport(containerName, null)).thenThrow(new ODataException("msg")); when(provider.getActionImport(containerName, null)).thenThrow(new ODataException("msg")); EdmProviderImpl edm = new EdmProviderImpl(provider); - EntityContainerInfo entityContainerInfo = - new EntityContainerInfo().setContainerName(containerName); + CsdlEntityContainerInfo entityContainerInfo = + new CsdlEntityContainerInfo().setContainerName(containerName); EdmEntityContainer container = new EdmEntityContainerImpl(edm, provider, entityContainerInfo); boolean thrown = false; try { @@ -232,64 +232,65 @@ public class EdmEntityContainerImplTest { assertNull(container.getEntitySet(null)); } - private class CustomProvider extends AbstractEdmProvider { + private class CustomProvider extends CsdlAbstractEdmProvider { @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { if (entitySetName != null) { - return new EntitySet().setName("entitySetName"); + return new CsdlEntitySet().setName("entitySetName"); } return null; } @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) throws ODataException { if (singletonName != null) { - return new Singleton().setName("singletonName"); + return new CsdlSingleton().setName("singletonName"); } return null; } @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) throws ODataException { if (actionImportName != null) { - return new ActionImport().setName("actionImportName"); + return new CsdlActionImport().setName("actionImportName"); } return null; } @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, + final String functionImportName) throws ODataException { if (functionImportName != null) { - return new FunctionImport().setName("functionImportName"); + return new CsdlFunctionImport().setName("functionImportName"); } return null; } @Override - public EntityContainer getEntityContainer() throws ODataException { - EntityContainer container = new EntityContainer(); - List entitySets = new ArrayList(); - entitySets.add(new EntitySet().setName("entitySetName")); - entitySets.add(new EntitySet().setName("entitySetName2")); + public CsdlEntityContainer getEntityContainer() throws ODataException { + CsdlEntityContainer container = new CsdlEntityContainer(); + List entitySets = new ArrayList(); + entitySets.add(new CsdlEntitySet().setName("entitySetName")); + entitySets.add(new CsdlEntitySet().setName("entitySetName2")); container.setEntitySets(entitySets); - List singletons = new ArrayList(); - singletons.add(new Singleton().setName("singletonName")); - singletons.add(new Singleton().setName("singletonName2")); + List singletons = new ArrayList(); + singletons.add(new CsdlSingleton().setName("singletonName")); + singletons.add(new CsdlSingleton().setName("singletonName2")); container.setSingletons(singletons); - List actionImports = new ArrayList(); - actionImports.add(new ActionImport().setName("actionImportName")); - actionImports.add(new ActionImport().setName("actionImportName2")); + List actionImports = new ArrayList(); + actionImports.add(new CsdlActionImport().setName("actionImportName")); + actionImports.add(new CsdlActionImport().setName("actionImportName2")); container.setActionImports(actionImports); - List functionImports = new ArrayList(); - functionImports.add(new FunctionImport().setName("functionImportName")); - functionImports.add(new FunctionImport().setName("functionImportName2")); + List functionImports = new ArrayList(); + functionImports.add(new CsdlFunctionImport().setName("functionImportName")); + functionImports.add(new CsdlFunctionImport().setName("functionImportName2")); container.setFunctionImports(functionImports); return container; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java index 0071ddd29..b80e59d49 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java @@ -30,12 +30,12 @@ import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; import org.apache.olingo.commons.core.edm.EdmEntityContainerImpl; import org.apache.olingo.commons.core.edm.EdmEntitySetImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; @@ -45,27 +45,27 @@ public class EdmEntitySetImplTest { @Test public void entitySet() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName typeName = new FullQualifiedName("ns", "entityType"); - final EntityType entityTypeProvider = new EntityType() + final CsdlEntityType entityTypeProvider = new CsdlEntityType() .setName(typeName.getName()) - .setKey(Arrays.asList(new PropertyRef().setName("Id"))); + .setKey(Arrays.asList(new CsdlPropertyRef().setName("Id"))); when(provider.getEntityType(typeName)).thenReturn(entityTypeProvider); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); - final EntityContainerInfo containerInfo = new EntityContainerInfo().setContainerName(containerName); + final CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(containerName); when(provider.getEntityContainerInfo(containerName)).thenReturn(containerInfo); final EdmEntityContainer entityContainer = new EdmEntityContainerImpl(edm, provider, containerInfo); final String entitySetName = "entitySet"; - final EntitySet entitySetProvider = new EntitySet() + final CsdlEntitySet entitySetProvider = new CsdlEntitySet() .setName(entitySetName) .setType(typeName) .setIncludeInServiceDocument(true) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding().setPath("path") + new CsdlNavigationPropertyBinding().setPath("path") .setTarget(containerName.getFullQualifiedNameAsString() + "/" + entitySetName))); when(provider.getEntitySet(containerName, entitySetName)).thenReturn(entitySetProvider); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java index 8c39ac66b..a0000fbdb 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java @@ -37,12 +37,12 @@ import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; import org.apache.olingo.commons.core.edm.EdmEntityTypeImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; @@ -58,62 +58,62 @@ public class EdmEntityTypeImplTest { @Before public void setupTypes() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); - EntityType baseType = new EntityType(); + CsdlEntityType baseType = new CsdlEntityType(); baseType.setName(baseName.getName()); - List properties = new ArrayList(); - properties.add(new Property().setName("Id").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - properties.add(new Property().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + List properties = new ArrayList(); + properties.add(new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + properties.add(new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); baseType.setProperties(properties); - List key = new ArrayList(); - key.add(new PropertyRef().setName("Id")); + List key = new ArrayList(); + key.add(new CsdlPropertyRef().setName("Id")); baseType.setKey(key); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("nav1")); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("nav1")); baseType.setNavigationProperties(navigationProperties); when(provider.getEntityType(baseName)).thenReturn(baseType); this.baseType = new EdmEntityTypeImpl(edm, baseName, baseType); FullQualifiedName typeName = new FullQualifiedName("namespace", "typeName"); - EntityType type = new EntityType(); + CsdlEntityType type = new CsdlEntityType(); type.setName(typeName.getName()); type.setBaseType(baseName); - List typeProperties = new ArrayList(); - typeProperties.add(new Property().setName("address").setType( + List typeProperties = new ArrayList(); + typeProperties.add(new CsdlProperty().setName("address").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeProperties.add(new Property().setName("email").setType( + typeProperties.add(new CsdlProperty().setName("email").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); type.setProperties(typeProperties); - List typeNavigationProperties = new ArrayList(); - typeNavigationProperties.add(new NavigationProperty().setName("nav2")); + List typeNavigationProperties = new ArrayList(); + typeNavigationProperties.add(new CsdlNavigationProperty().setName("nav2")); type.setNavigationProperties(typeNavigationProperties); when(provider.getEntityType(typeName)).thenReturn(type); typeWithBaseType = new EdmEntityTypeImpl(edm, typeName, type); FullQualifiedName typeWithComplexKeyName = new FullQualifiedName("namespace", "typeName"); - EntityType typeWithComplexKeyProvider = new EntityType(); + CsdlEntityType typeWithComplexKeyProvider = new CsdlEntityType(); typeWithComplexKeyProvider.setName(typeWithComplexKeyName.getName()); - List typeWithComplexKeyProperties = new ArrayList(); - typeWithComplexKeyProperties.add(new Property().setName("Id").setType( + List typeWithComplexKeyProperties = new ArrayList(); + typeWithComplexKeyProperties.add(new CsdlProperty().setName("Id").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - List complexTypeProperties = new ArrayList(); - complexTypeProperties.add(new Property().setName("ComplexPropName").setType( + List complexTypeProperties = new ArrayList(); + complexTypeProperties.add(new CsdlProperty().setName("ComplexPropName").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); FullQualifiedName complexTypeName = new FullQualifiedName("namespace", "complexTypeName"); when(provider.getComplexType(complexTypeName)).thenReturn( - new ComplexType().setName("complexTypeName").setProperties(complexTypeProperties)); + new CsdlComplexType().setName("complexTypeName").setProperties(complexTypeProperties)); - typeWithComplexKeyProperties.add(new Property().setName("Comp").setType(complexTypeName)); + typeWithComplexKeyProperties.add(new CsdlProperty().setName("Comp").setType(complexTypeName)); typeWithComplexKeyProvider.setProperties(typeWithComplexKeyProperties); - List keyForTypeWithComplexKey = new ArrayList(); - keyForTypeWithComplexKey.add(new PropertyRef().setName("Id")); - keyForTypeWithComplexKey.add(new PropertyRef().setName("Comp/ComplexPropName").setAlias("alias")); + List keyForTypeWithComplexKey = new ArrayList(); + keyForTypeWithComplexKey.add(new CsdlPropertyRef().setName("Id")); + keyForTypeWithComplexKey.add(new CsdlPropertyRef().setName("Comp/ComplexPropName").setAlias("alias")); typeWithComplexKeyProvider.setKey(keyForTypeWithComplexKey); when(provider.getEntityType(typeWithComplexKeyName)).thenReturn(typeWithComplexKeyProvider); @@ -122,18 +122,18 @@ public class EdmEntityTypeImplTest { @Test public void testAbstractBaseTypeWithoutKey() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); - EntityType baseType = new EntityType(); + CsdlEntityType baseType = new CsdlEntityType(); baseType.setName(baseName.getName()); - List properties = new ArrayList(); - properties.add(new Property().setName("Id").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - properties.add(new Property().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + List properties = new ArrayList(); + properties.add(new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + properties.add(new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); baseType.setProperties(properties); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("nav1")); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("nav1")); baseType.setNavigationProperties(navigationProperties); when(provider.getEntityType(baseName)).thenReturn(baseType); baseType.setAbstract(true); @@ -144,20 +144,20 @@ public class EdmEntityTypeImplTest { assertEquals("Name", edmAbstarctBaseType.getPropertyNames().get(1)); FullQualifiedName typeName = new FullQualifiedName("namespace", "typeName"); - EntityType type = new EntityType(); + CsdlEntityType type = new CsdlEntityType(); type.setName(typeName.getName()); type.setBaseType(baseName); - List typeProperties = new ArrayList(); - typeProperties.add(new Property().setName("address").setType( + List typeProperties = new ArrayList(); + typeProperties.add(new CsdlProperty().setName("address").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeProperties.add(new Property().setName("email").setType( + typeProperties.add(new CsdlProperty().setName("email").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); type.setProperties(typeProperties); - List key = new ArrayList(); - key.add(new PropertyRef().setName("email")); + List key = new ArrayList(); + key.add(new CsdlPropertyRef().setName("email")); type.setKey(key); - List typeNavigationProperties = new ArrayList(); - typeNavigationProperties.add(new NavigationProperty().setName("nav2")); + List typeNavigationProperties = new ArrayList(); + typeNavigationProperties.add(new CsdlNavigationProperty().setName("nav2")); type.setNavigationProperties(typeNavigationProperties); when(provider.getEntityType(typeName)).thenReturn(type); @@ -182,38 +182,38 @@ public class EdmEntityTypeImplTest { @Test public void testAbstractBaseTypeWithtKey() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); - EntityType baseType = new EntityType(); + CsdlEntityType baseType = new CsdlEntityType(); baseType.setName(baseName.getName()); - List properties = new ArrayList(); - properties.add(new Property().setName("Id").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - properties.add(new Property().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + List properties = new ArrayList(); + properties.add(new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + properties.add(new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); baseType.setProperties(properties); - List key = new ArrayList(); - key.add(new PropertyRef().setName("Id")); + List key = new ArrayList(); + key.add(new CsdlPropertyRef().setName("Id")); baseType.setKey(key); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("nav1")); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("nav1")); baseType.setNavigationProperties(navigationProperties); when(provider.getEntityType(baseName)).thenReturn(baseType); baseType.setAbstract(true); EdmEntityType edmAbstarctBaseType = new EdmEntityTypeImpl(edm, baseName, baseType); FullQualifiedName typeName = new FullQualifiedName("namespace", "typeName"); - EntityType type = new EntityType(); + CsdlEntityType type = new CsdlEntityType(); type.setName(typeName.getName()); type.setBaseType(baseName); - List typeProperties = new ArrayList(); - typeProperties.add(new Property().setName("address").setType( + List typeProperties = new ArrayList(); + typeProperties.add(new CsdlProperty().setName("address").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeProperties.add(new Property().setName("email").setType( + typeProperties.add(new CsdlProperty().setName("email").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); type.setProperties(typeProperties); - List typeNavigationProperties = new ArrayList(); - typeNavigationProperties.add(new NavigationProperty().setName("nav2")); + List typeNavigationProperties = new ArrayList(); + typeNavigationProperties.add(new CsdlNavigationProperty().setName("nav2")); type.setNavigationProperties(typeNavigationProperties); when(provider.getEntityType(typeName)).thenReturn(type); EdmEntityType edmType = new EdmEntityTypeImpl(edm, typeName, type); @@ -366,25 +366,25 @@ public class EdmEntityTypeImplTest { @Test public void abstractTypeDoesNotNeedKey() { EdmProviderImpl edm = mock(EdmProviderImpl.class); - EntityType entityType = new EntityType().setName("n").setAbstract(true); + CsdlEntityType entityType = new CsdlEntityType().setName("n").setAbstract(true); new EdmEntityTypeImpl(edm, new FullQualifiedName("n", "n"), entityType); } @Test(expected = EdmException.class) public void invalidBaseType() { EdmProviderImpl edm = mock(EdmProviderImpl.class); - EntityType entityType = new EntityType().setName("n").setBaseType(new FullQualifiedName("wrong", "wrong")); + CsdlEntityType entityType = new CsdlEntityType().setName("n").setBaseType(new FullQualifiedName("wrong", "wrong")); EdmEntityTypeImpl instance = new EdmEntityTypeImpl(edm, new FullQualifiedName("n", "n"), entityType); instance.getBaseType(); } @Test public void abstractTypeWithAbstractBaseTypeDoesNotNeedKey() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("n", "base"); - when(provider.getEntityType(baseName)).thenReturn(new EntityType().setName("base").setAbstract(true)); - EntityType entityType = new EntityType().setName("n").setAbstract(true).setBaseType(baseName); + when(provider.getEntityType(baseName)).thenReturn(new CsdlEntityType().setName("base").setAbstract(true)); + CsdlEntityType entityType = new CsdlEntityType().setName("n").setAbstract(true).setBaseType(baseName); new EdmEntityTypeImpl(edm, new FullQualifiedName("n", "n"), entityType); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java index edc9a21b8..054f9d815 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java @@ -26,8 +26,8 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.EnumMember; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.apache.olingo.commons.core.edm.EdmEnumTypeImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; @@ -57,51 +57,51 @@ public class EdmEnumTest { private final EdmEnumType int32FlagType; public EdmEnumTest() { - final List memberList = Arrays.asList( - new EnumMember().setName("first").setValue("1"), - new EnumMember().setName("second").setValue("64")); + final List memberList = Arrays.asList( + new CsdlEnumMember().setName("first").setValue("1"), + new CsdlEnumMember().setName("second").setValue("64")); final FullQualifiedName enumName = new FullQualifiedName("namespace", "name"); instance = new EdmEnumTypeImpl(mock(EdmProviderImpl.class), enumName, - new EnumType().setName("name").setMembers(memberList).setFlags(true) + new CsdlEnumType().setName("name").setMembers(memberList).setFlags(true) .setUnderlyingType(EdmPrimitiveTypeKind.SByte.getFullQualifiedName())); nonFlagsInstance = new EdmEnumTypeImpl(mock(EdmProviderImpl.class), enumName, - new EnumType().setName("name").setMembers(memberList).setFlags(false) + new CsdlEnumType().setName("name").setMembers(memberList).setFlags(false) .setUnderlyingType(EdmPrimitiveTypeKind.SByte.getFullQualifiedName())); int16EnumType = new EdmEnumTypeImpl(Mockito.mock(Edm.class), - new FullQualifiedName("testNamespace", "testName"), new EnumType() + new FullQualifiedName("testNamespace", "testName"), new CsdlEnumType() .setName("MyEnum") .setFlags(false) .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()) .setMembers( Arrays.asList( - new EnumMember().setName("A") + new CsdlEnumMember().setName("A") .setValue("0"), - new EnumMember().setName("B") + new CsdlEnumMember().setName("B") .setValue("1"), - new EnumMember().setName("C") + new CsdlEnumMember().setName("C") .setValue("2")))); int32EnumType = new EdmEnumTypeImpl(Mockito.mock(Edm.class), - new FullQualifiedName("testNamespace", "testName"), new EnumType() + new FullQualifiedName("testNamespace", "testName"), new CsdlEnumType() .setName("MyEnum") .setFlags(false) .setUnderlyingType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName()) .setMembers(Arrays - .asList(new EnumMember().setName("A").setValue("0"), new EnumMember().setName("B").setValue("1"), - new EnumMember().setName("C").setValue("2")))); + .asList(new CsdlEnumMember().setName("A").setValue("0"), new CsdlEnumMember().setName("B").setValue("1"), + new CsdlEnumMember().setName("C").setValue("2")))); int32FlagType = new EdmEnumTypeImpl(Mockito.mock(Edm.class), - new FullQualifiedName("testNamespace", "testName"), new EnumType() + new FullQualifiedName("testNamespace", "testName"), new CsdlEnumType() .setName("MyEnum") .setFlags(true) .setUnderlyingType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName()) .setMembers(Arrays - .asList(new EnumMember().setName("A").setValue("2"), new EnumMember().setName("B").setValue("4"), - new EnumMember().setName("C").setValue("8")))); + .asList(new CsdlEnumMember().setName("A").setValue("2"), new CsdlEnumMember().setName("B").setValue("4"), + new CsdlEnumMember().setName("C").setValue("8")))); } @Test @@ -130,7 +130,7 @@ public class EdmEnumTest { assertEquals(Byte.class, instance.getDefaultType()); EdmEnumType instance = new EdmEnumTypeImpl(Mockito.mock(Edm.class), new FullQualifiedName("testNamespace", "testName"), - new EnumType() + new CsdlEnumType() .setName("MyEnum")); assertEquals(Integer.class, instance.getUnderlyingType().getDefaultType()); } @@ -267,13 +267,13 @@ public class EdmEnumTest { @SuppressWarnings("unused") EdmEnumType instance = new EdmEnumTypeImpl(Mockito.mock(Edm.class), new FullQualifiedName("testNamespace", "testName"), - new EnumType() + new CsdlEnumType() .setName("MyEnum") .setFlags(false) .setUnderlyingType(underlyingType.getFullQualifiedName()) .setMembers( Arrays.asList( - new EnumMember().setName("A") + new CsdlEnumMember().setName("A") .setValue("0")))); fail("Expected exception not thrown"); } catch (final EdmException e) { diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java index 8adab013e..477dee4bb 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java @@ -22,8 +22,8 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; import org.apache.olingo.commons.core.edm.EdmFunctionImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; @@ -45,9 +45,10 @@ public class EdmFunctionImplTest { public void setupFunctions() { EdmProviderImpl provider = mock(EdmProviderImpl.class); - Function function1 = new Function().setReturnType(new ReturnType().setType(new FullQualifiedName("Edm", "String"))); + CsdlFunction function1 = new CsdlFunction().setReturnType( + new CsdlReturnType().setType(new FullQualifiedName("Edm", "String"))); functionImpl1 = new EdmFunctionImpl(provider, new FullQualifiedName("namespace", "name"), function1); - Function function2 = new Function().setComposable(true); + CsdlFunction function2 = new CsdlFunction().setComposable(true); functionImpl2 = new EdmFunctionImpl(provider, new FullQualifiedName("namespace", "name"), function2); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java index 002ec0551..730322b60 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java @@ -23,12 +23,12 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.apache.olingo.commons.core.edm.EdmEntityContainerImpl; import org.apache.olingo.commons.core.edm.EdmFunctionImportImpl; @@ -48,25 +48,25 @@ public class EdmFunctionImportImplTest { @Test public void functionImport() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName functionName = new FullQualifiedName("ns", "function"); - final Function functionProvider = new Function() + final CsdlFunction functionProvider = new CsdlFunction() .setName(functionName.getName()) - .setParameters(Collections. emptyList()) + .setParameters(Collections. emptyList()) .setBound(false) .setComposable(false) - .setReturnType(new ReturnType().setType(EdmPrimitiveTypeKind.Boolean.getFullQualifiedName())); + .setReturnType(new CsdlReturnType().setType(EdmPrimitiveTypeKind.Boolean.getFullQualifiedName())); when(provider.getFunctions(functionName)).thenReturn(Arrays.asList(functionProvider)); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); - final EntityContainerInfo containerInfo = new EntityContainerInfo().setContainerName(containerName); + final CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(containerName); when(provider.getEntityContainerInfo(containerName)).thenReturn(containerInfo); final EdmEntityContainer entityContainer = new EdmEntityContainerImpl(edm, provider, containerInfo); final String functionImportName = "functionImport"; - final FunctionImport functionImportProvider = new FunctionImport() + final CsdlFunctionImport functionImportProvider = new CsdlFunctionImport() .setName(functionImportName) .setFunction(functionName) .setIncludeInServiceDocument(true); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java index d4e957adb..187534b2a 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java @@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef; import org.apache.olingo.commons.api.edm.EdmProperty; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; import org.apache.olingo.commons.core.edm.EdmKeyPropertyRefImpl; import org.junit.Test; @@ -39,7 +39,7 @@ public class EdmKeyPropertyRefImplTest { @Test public void noAlias() { - PropertyRef providerRef = new PropertyRef().setName("Id"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("Id"); EdmEntityType etMock = mock(EdmEntityType.class); EdmProperty keyPropertyMock = mock(EdmProperty.class); when(etMock.getStructuralProperty("Id")).thenReturn(keyPropertyMock); @@ -55,7 +55,7 @@ public class EdmKeyPropertyRefImplTest { @Test public void aliasForPropertyInComplexPropertyOneLevel() { - PropertyRef providerRef = new PropertyRef().setName("comp/Id").setAlias("alias"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("comp/Id").setAlias("alias"); EdmEntityType etMock = mock(EdmEntityType.class); EdmProperty keyPropertyMock = mock(EdmProperty.class); EdmProperty compMock = mock(EdmProperty.class); @@ -73,7 +73,7 @@ public class EdmKeyPropertyRefImplTest { @Test(expected = EdmException.class) public void aliasForPropertyInComplexPropertyButWrongPath() { - PropertyRef providerRef = new PropertyRef().setName("comp/wrong").setAlias("alias"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("comp/wrong").setAlias("alias"); EdmEntityType etMock = mock(EdmEntityType.class); EdmProperty keyPropertyMock = mock(EdmProperty.class); EdmElement compMock = mock(EdmProperty.class); @@ -86,7 +86,7 @@ public class EdmKeyPropertyRefImplTest { @Test(expected = EdmException.class) public void aliasForPropertyInComplexPropertyButWrongPath2() { - PropertyRef providerRef = new PropertyRef().setName("wrong/Id").setAlias("alias"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("wrong/Id").setAlias("alias"); EdmEntityType etMock = mock(EdmEntityType.class); EdmProperty keyPropertyMock = mock(EdmProperty.class); EdmElement compMock = mock(EdmProperty.class); @@ -99,7 +99,7 @@ public class EdmKeyPropertyRefImplTest { @Test public void aliasForPropertyInComplexPropertyTwoLevels() { - PropertyRef providerRef = new PropertyRef().setName("comp/comp2/Id").setAlias("alias"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("comp/comp2/Id").setAlias("alias"); EdmEntityType etMock = mock(EdmEntityType.class); EdmProperty keyPropertyMock = mock(EdmProperty.class); EdmProperty compMock = mock(EdmProperty.class); @@ -120,21 +120,21 @@ public class EdmKeyPropertyRefImplTest { @Test(expected = EdmException.class) public void oneKeyNoAliasButInvalidProperty() { - PropertyRef providerRef = new PropertyRef().setName("Id"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("Id"); EdmKeyPropertyRef ref = new EdmKeyPropertyRefImpl(mock(EdmEntityType.class), providerRef); ref.getProperty(); } @Test(expected = EdmException.class) public void aliasButNoPath() { - PropertyRef providerRef = new PropertyRef().setName("Id").setAlias("alias"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("Id").setAlias("alias"); EdmKeyPropertyRef ref = new EdmKeyPropertyRefImpl(mock(EdmEntityType.class), providerRef); ref.getProperty(); } @Test(expected = EdmException.class) public void aliasButEmptyPath() { - PropertyRef providerRef = new PropertyRef().setName("").setAlias("alias"); + CsdlPropertyRef providerRef = new CsdlPropertyRef().setName("").setAlias("alias"); EdmKeyPropertyRef ref = new EdmKeyPropertyRefImpl(mock(EdmEntityType.class), providerRef); ref.getProperty(); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java index 5730d40b6..c284edffe 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java @@ -28,9 +28,9 @@ import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Mapping; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlMapping; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; import org.apache.olingo.commons.core.edm.EdmParameterImpl; import org.apache.olingo.commons.core.edm.EdmPropertyImpl; import org.junit.Test; @@ -39,12 +39,12 @@ public class EdmMappingTest { @Test public void initialMappingMustBeNull() { - Property property = new Property().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()); + CsdlProperty property = new CsdlProperty().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()); EdmProperty edmProperty = new EdmPropertyImpl(null, new FullQualifiedName("namespace.name"), property); assertNull(edmProperty.getMapping()); - Parameter parameter = new Parameter().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()); + CsdlParameter parameter = new CsdlParameter().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()); EdmParameter edmParameter = new EdmParameterImpl(null, parameter); assertNull(edmParameter.getMapping()); @@ -52,8 +52,8 @@ public class EdmMappingTest { @Test public void getDataClassForPrimTypeViaMapping() { - Mapping mapping = new Mapping().setMappedJavaClass(Date.class); - Property property = new Property() + CsdlMapping mapping = new CsdlMapping().setMappedJavaClass(Date.class); + CsdlProperty property = new CsdlProperty() .setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()) .setMapping(mapping); EdmProperty edmProperty = new EdmPropertyImpl(null, new FullQualifiedName("namespace.name"), property); @@ -61,7 +61,7 @@ public class EdmMappingTest { assertNotNull(edmProperty.getMapping()); assertEquals(Date.class, edmProperty.getMapping().getMappedJavaClass()); - Parameter parameter = new Parameter() + CsdlParameter parameter = new CsdlParameter() .setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()) .setMapping(mapping); EdmParameter edmParameter = new EdmParameterImpl(null, parameter); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java index a0c29442f..d6ae3a7b2 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.core.edm.provider; -import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; import org.apache.olingo.commons.core.edm.EdmMemberImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Test; @@ -30,7 +30,7 @@ public class EdmMemberImplTest { @Test public void enumMember() { - final EnumMember member = new EnumMember().setName("name").setValue("value"); + final CsdlEnumMember member = new CsdlEnumMember().setName("name").setValue("value"); final EdmMemberImpl memberImpl = new EdmMemberImpl(mock(EdmProviderImpl.class), null, member); assertEquals("name", memberImpl.getName()); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java index 4751f59ba..fee567327 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java @@ -23,11 +23,11 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint; import org.apache.olingo.commons.core.edm.EdmNavigationPropertyImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Test; @@ -48,13 +48,13 @@ public class EdmNavigationPropertyImplTest { @Test public void navigationProperty() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName entityTypeName = new FullQualifiedName("ns", "entity"); - EntityType entityTypeProvider = new EntityType(); - entityTypeProvider.setKey(Collections. emptyList()); + CsdlEntityType entityTypeProvider = new CsdlEntityType(); + entityTypeProvider.setKey(Collections. emptyList()); when(provider.getEntityType(entityTypeName)).thenReturn(entityTypeProvider); - NavigationProperty propertyProvider = new NavigationProperty(); + CsdlNavigationProperty propertyProvider = new CsdlNavigationProperty(); propertyProvider.setType(entityTypeName); propertyProvider.setNullable(false); EdmNavigationProperty property = new EdmNavigationPropertyImpl(edm, entityTypeName, propertyProvider); @@ -74,17 +74,17 @@ public class EdmNavigationPropertyImplTest { @Test public void navigationPropertyWithReferntialConstraint() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName entityTypeName = new FullQualifiedName("ns", "entity"); - EntityType entityTypeProvider = new EntityType(); - entityTypeProvider.setKey(Collections. emptyList()); + CsdlEntityType entityTypeProvider = new CsdlEntityType(); + entityTypeProvider.setKey(Collections. emptyList()); when(provider.getEntityType(entityTypeName)).thenReturn(entityTypeProvider); - NavigationProperty propertyProvider = new NavigationProperty(); + CsdlNavigationProperty propertyProvider = new CsdlNavigationProperty(); propertyProvider.setType(entityTypeName); propertyProvider.setNullable(false); - List referentialConstraints = new ArrayList(); - referentialConstraints.add(new ReferentialConstraint().setProperty("property").setReferencedProperty( + List referentialConstraints = new ArrayList(); + referentialConstraints.add(new CsdlReferentialConstraint().setProperty("property").setReferencedProperty( "referencedProperty")); propertyProvider.setReferentialConstraints(referentialConstraints); EdmNavigationProperty property = new EdmNavigationPropertyImpl(edm, entityTypeName, propertyProvider); @@ -94,17 +94,17 @@ public class EdmNavigationPropertyImplTest { @Test public void navigationPropertyWithPartner() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName entityTypeName = new FullQualifiedName("ns", "entity"); - EntityType entityTypeProvider = new EntityType(); - entityTypeProvider.setKey(Collections. emptyList()); + CsdlEntityType entityTypeProvider = new CsdlEntityType(); + entityTypeProvider.setKey(Collections. emptyList()); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("partnerName").setType(entityTypeName)); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("partnerName").setType(entityTypeName)); entityTypeProvider.setNavigationProperties(navigationProperties); when(provider.getEntityType(entityTypeName)).thenReturn(entityTypeProvider); - NavigationProperty propertyProvider = new NavigationProperty(); + CsdlNavigationProperty propertyProvider = new CsdlNavigationProperty(); propertyProvider.setType(entityTypeName); propertyProvider.setNullable(false); propertyProvider.setPartner("partnerName"); @@ -118,17 +118,17 @@ public class EdmNavigationPropertyImplTest { @Test(expected = EdmException.class) public void navigationPropertyWithNonexistentPartner() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName entityTypeName = new FullQualifiedName("ns", "entity"); - EntityType entityTypeProvider = new EntityType(); - entityTypeProvider.setKey(Collections. emptyList()); + CsdlEntityType entityTypeProvider = new CsdlEntityType(); + entityTypeProvider.setKey(Collections. emptyList()); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("partnerName").setType(entityTypeName)); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("partnerName").setType(entityTypeName)); entityTypeProvider.setNavigationProperties(navigationProperties); when(provider.getEntityType(entityTypeName)).thenReturn(entityTypeProvider); - NavigationProperty propertyProvider = new NavigationProperty(); + CsdlNavigationProperty propertyProvider = new CsdlNavigationProperty(); propertyProvider.setType(entityTypeName); propertyProvider.setNullable(false); propertyProvider.setPartner("wrong"); @@ -139,7 +139,7 @@ public class EdmNavigationPropertyImplTest { @Test(expected = EdmException.class) public void navigationPropertyWithNonExistentType() throws Exception { EdmProviderImpl edm = mock(EdmProviderImpl.class); - NavigationProperty propertyProvider = new NavigationProperty(); + CsdlNavigationProperty propertyProvider = new CsdlNavigationProperty(); EdmNavigationProperty property = new EdmNavigationPropertyImpl(edm, null, propertyProvider); property.getType(); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java index bbcea0b08..d14fdbada 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java @@ -25,11 +25,11 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.commons.core.edm.EdmParameterImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Test; @@ -44,8 +44,8 @@ public class EdmParameterImplTest { @Test public void getTypeReturnsPrimitiveType() { - EdmProviderImpl edm = new EdmProviderImpl(mock(EdmProvider.class)); - Parameter parameterProvider = new Parameter(); + EdmProviderImpl edm = new EdmProviderImpl(mock(CsdlEdmProvider.class)); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(EdmPrimitiveTypeKind.Binary.getFullQualifiedName()); final EdmParameter parameter = new EdmParameterImpl(edm, parameterProvider); final EdmType type = parameter.getType(); @@ -56,12 +56,12 @@ public class EdmParameterImplTest { @Test public void getTypeReturnsComplexType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName complexTypeName = new FullQualifiedName("ns", "complex"); - ComplexType complexTypeProvider = new ComplexType(); + CsdlComplexType complexTypeProvider = new CsdlComplexType(); when(provider.getComplexType(complexTypeName)).thenReturn(complexTypeProvider); - Parameter parameterProvider = new Parameter(); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(complexTypeName); final EdmParameter parameter = new EdmParameterImpl(edm, parameterProvider); assertFalse(parameter.isCollection()); @@ -73,12 +73,12 @@ public class EdmParameterImplTest { @Test public void getTypeReturnsEnumType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName enumTypeName = new FullQualifiedName("ns", "enum"); - EnumType enumTypeProvider = new EnumType(); + CsdlEnumType enumTypeProvider = new CsdlEnumType(); when(provider.getEnumType(enumTypeName)).thenReturn(enumTypeProvider); - Parameter parameterProvider = new Parameter(); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(enumTypeName); final EdmParameter parameter = new EdmParameterImpl(edm, parameterProvider); assertFalse(parameter.isCollection()); @@ -90,12 +90,13 @@ public class EdmParameterImplTest { @Test public void getTypeReturnsTypeDefinition() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName typeName = new FullQualifiedName("ns", "definition"); - TypeDefinition typeProvider = new TypeDefinition().setUnderlyingType(new FullQualifiedName("Edm", "String")); + CsdlTypeDefinition typeProvider = + new CsdlTypeDefinition().setUnderlyingType(new FullQualifiedName("Edm", "String")); when(provider.getTypeDefinition(typeName)).thenReturn(typeProvider); - Parameter parameterProvider = new Parameter(); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(typeName); final EdmParameter parameter = new EdmParameterImpl(edm, parameterProvider); final EdmType type = parameter.getType(); @@ -106,8 +107,8 @@ public class EdmParameterImplTest { @Test public void facets() { - EdmProviderImpl edm = new EdmProviderImpl(mock(EdmProvider.class)); - Parameter parameterProvider = new Parameter(); + EdmProviderImpl edm = new EdmProviderImpl(mock(CsdlEdmProvider.class)); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()); parameterProvider.setPrecision(42); parameterProvider.setScale(12); @@ -123,8 +124,8 @@ public class EdmParameterImplTest { @Test(expected = EdmException.class) public void getTypeWithInvalidSimpleType() { - EdmProviderImpl edm = new EdmProviderImpl(mock(EdmProvider.class)); - Parameter parameterProvider = new Parameter(); + EdmProviderImpl edm = new EdmProviderImpl(mock(CsdlEdmProvider.class)); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(new FullQualifiedName("Edm", "wrong")); final EdmParameter parameter = new EdmParameterImpl(edm, parameterProvider); parameter.getType(); @@ -132,8 +133,8 @@ public class EdmParameterImplTest { @Test(expected = EdmException.class) public void getTypeWithNonexistingType() { - EdmProviderImpl edm = new EdmProviderImpl(mock(EdmProvider.class)); - Parameter parameterProvider = new Parameter(); + EdmProviderImpl edm = new EdmProviderImpl(mock(CsdlEdmProvider.class)); + CsdlParameter parameterProvider = new CsdlParameter(); parameterProvider.setType(new FullQualifiedName("wrong", "wrong")); final EdmParameter parameter = new EdmParameterImpl(edm, parameterProvider); parameter.getType(); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java index cc3e81949..b071c278d 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java @@ -25,11 +25,11 @@ import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.commons.core.edm.EdmPropertyImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Test; @@ -46,8 +46,8 @@ public class EdmPropertyImplTest { @Test public void getTypeReturnsPrimitiveType() { - EdmProviderImpl edm = new EdmProviderImpl(mock(EdmProvider.class)); - Property propertyProvider = new Property(); + EdmProviderImpl edm = new EdmProviderImpl(mock(CsdlEdmProvider.class)); + CsdlProperty propertyProvider = new CsdlProperty(); propertyProvider.setType(EdmPrimitiveTypeKind.Binary.getFullQualifiedName()); final EdmProperty property = new EdmPropertyImpl(edm, null, propertyProvider); assertTrue(property.isPrimitive()); @@ -59,12 +59,12 @@ public class EdmPropertyImplTest { @Test public void getTypeReturnsComplexType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName complexTypeName = new FullQualifiedName("ns", "complex"); - ComplexType complexTypeProvider = new ComplexType(); + CsdlComplexType complexTypeProvider = new CsdlComplexType(); when(provider.getComplexType(complexTypeName)).thenReturn(complexTypeProvider); - Property propertyProvider = new Property(); + CsdlProperty propertyProvider = new CsdlProperty(); propertyProvider.setType(complexTypeName); final EdmProperty property = new EdmPropertyImpl(edm, complexTypeName, propertyProvider); assertFalse(property.isCollection()); @@ -77,12 +77,12 @@ public class EdmPropertyImplTest { @Test public void getTypeReturnsEnumType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName enumTypeName = new FullQualifiedName("ns", "enum"); - EnumType enumTypeProvider = new EnumType(); + CsdlEnumType enumTypeProvider = new CsdlEnumType(); when(provider.getEnumType(enumTypeName)).thenReturn(enumTypeProvider); - Property propertyProvider = new Property(); + CsdlProperty propertyProvider = new CsdlProperty(); propertyProvider.setType(enumTypeName); final EdmProperty property = new EdmPropertyImpl(edm, null, propertyProvider); assertFalse(property.isCollection()); @@ -95,12 +95,13 @@ public class EdmPropertyImplTest { @Test public void getTypeReturnsTypeDefinition() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName typeName = new FullQualifiedName("ns", "definition"); - TypeDefinition typeProvider = new TypeDefinition().setUnderlyingType(new FullQualifiedName("Edm", "String")); + CsdlTypeDefinition typeProvider = + new CsdlTypeDefinition().setUnderlyingType(new FullQualifiedName("Edm", "String")); when(provider.getTypeDefinition(typeName)).thenReturn(typeProvider); - Property propertyProvider = new Property(); + CsdlProperty propertyProvider = new CsdlProperty(); propertyProvider.setType(typeName); final EdmProperty property = new EdmPropertyImpl(edm, null, propertyProvider); assertFalse(property.isPrimitive()); @@ -112,9 +113,9 @@ public class EdmPropertyImplTest { @Test(expected = EdmException.class) public void getTypeReturnsWrongType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); - final Property propertyProvider = new Property() + final CsdlProperty propertyProvider = new CsdlProperty() .setType(new FullQualifiedName("ns", "wrong")); final EdmProperty property = new EdmPropertyImpl(edm, null, propertyProvider); property.getType(); @@ -123,9 +124,9 @@ public class EdmPropertyImplTest { @Test(expected = EdmException.class) public void getTypeReturnsNoTypeKind() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); - final Property propertyProvider = new Property() + final CsdlProperty propertyProvider = new CsdlProperty() .setType(new FullQualifiedName(EdmPrimitiveType.EDM_NAMESPACE, "type")); final EdmProperty property = new EdmPropertyImpl(edm, null, propertyProvider); property.getType(); @@ -134,8 +135,8 @@ public class EdmPropertyImplTest { @Test public void facets() { - EdmProviderImpl edm = new EdmProviderImpl(mock(EdmProvider.class)); - Property propertyProvider = new Property(); + EdmProviderImpl edm = new EdmProviderImpl(mock(CsdlEdmProvider.class)); + CsdlProperty propertyProvider = new CsdlProperty(); propertyProvider.setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()); propertyProvider.setPrecision(42); propertyProvider.setScale(12); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java index f7fb6c59f..3db70de9d 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java @@ -23,10 +23,10 @@ import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; import org.junit.Test; @@ -54,48 +54,48 @@ public class EdmProviderImplOverloadingTest { @Before public void setup() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); - List actions = new ArrayList(); - Action action = new Action().setName(operationName1.getName()); + List actions = new ArrayList(); + CsdlAction action = new CsdlAction().setName(operationName1.getName()); actions.add(action); - List action1Parameters = new ArrayList(); - action1Parameters.add(new Parameter().setType(operationType1).setCollection(false)); + List action1Parameters = new ArrayList(); + action1Parameters.add(new CsdlParameter().setType(operationType1).setCollection(false)); action = - new Action().setName(operationName1.getName()).setBound(true).setParameters(action1Parameters); + new CsdlAction().setName(operationName1.getName()).setBound(true).setParameters(action1Parameters); actions.add(action); - List action2Parameters = new ArrayList(); - action2Parameters.add(new Parameter().setType(operationType1).setCollection(true)); + List action2Parameters = new ArrayList(); + action2Parameters.add(new CsdlParameter().setType(operationType1).setCollection(true)); action = - new Action().setName(operationName1.getName()).setBound(true).setParameters(action2Parameters); + new CsdlAction().setName(operationName1.getName()).setBound(true).setParameters(action2Parameters); actions.add(action); when(provider.getActions(operationName1)).thenReturn(actions); - List functions = new ArrayList(); - Function function = new Function().setName(operationName1.getName()); + List functions = new ArrayList(); + CsdlFunction function = new CsdlFunction().setName(operationName1.getName()); functions.add(function); - List function1Parameters = new ArrayList(); - function1Parameters.add(new Parameter().setType(operationType1).setName("a")); - function = new Function().setName(operationName1.getName()).setParameters(function1Parameters); + List function1Parameters = new ArrayList(); + function1Parameters.add(new CsdlParameter().setType(operationType1).setName("a")); + function = new CsdlFunction().setName(operationName1.getName()).setParameters(function1Parameters); functions.add(function); - List function2Parameters = new ArrayList(); - function2Parameters.add(new Parameter().setType(operationType1).setName("b")); - function = new Function().setName(operationName1.getName()).setParameters(function2Parameters); + List function2Parameters = new ArrayList(); + function2Parameters.add(new CsdlParameter().setType(operationType1).setName("b")); + function = new CsdlFunction().setName(operationName1.getName()).setParameters(function2Parameters); functions.add(function); - List function3Parameters = new ArrayList(); - function3Parameters.add(new Parameter().setName("a").setType(operationType1)); - function3Parameters.add(new Parameter().setName("b").setType(operationType1)); - function = new Function().setName(operationName1.getName()).setParameters(function3Parameters).setBound(true); + List function3Parameters = new ArrayList(); + function3Parameters.add(new CsdlParameter().setName("a").setType(operationType1)); + function3Parameters.add(new CsdlParameter().setName("b").setType(operationType1)); + function = new CsdlFunction().setName(operationName1.getName()).setParameters(function3Parameters).setBound(true); functions.add(function); - List function4Parameters = new ArrayList(); - function4Parameters.add(new Parameter().setName("a").setType(operationType2)); - function4Parameters.add(new Parameter().setName("b").setType(operationType2)); - function = new Function().setName(operationName1.getName()).setParameters(function4Parameters).setBound(true); + List function4Parameters = new ArrayList(); + function4Parameters.add(new CsdlParameter().setName("a").setType(operationType2)); + function4Parameters.add(new CsdlParameter().setName("b").setType(operationType2)); + function = new CsdlFunction().setName(operationName1.getName()).setParameters(function4Parameters).setBound(true); functions.add(function); when(provider.getFunctions(operationName1)).thenReturn(functions); - List badFunctions = new ArrayList(); - Function badFunction = new Function().setName(operationName1.getName()).setBound(true).setParameters(null); + List badFunctions = new ArrayList(); + CsdlFunction badFunction = new CsdlFunction().setName(operationName1.getName()).setBound(true).setParameters(null); badFunctions.add(badFunction); when(provider.getFunctions(badOperationName)).thenReturn(badFunctions); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java index aa98ad8a3..089f4f000 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java @@ -27,14 +27,14 @@ import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; import org.junit.Test; @@ -59,26 +59,26 @@ public class EdmProviderImplTest { @Before public void setup() throws Exception { - EdmProvider provider = mock(EdmProvider.class); - EntityContainerInfo containerInfo = new EntityContainerInfo().setContainerName(FQN); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); + CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(FQN); when(provider.getEntityContainerInfo(FQN)).thenReturn(containerInfo); when(provider.getEntityContainerInfo(null)).thenReturn(containerInfo); - EnumType enumType = new EnumType().setName(FQN.getName()); + CsdlEnumType enumType = new CsdlEnumType().setName(FQN.getName()); when(provider.getEnumType(FQN)).thenReturn(enumType); - TypeDefinition typeDefinition = - new TypeDefinition().setName(FQN.getName()).setUnderlyingType(new FullQualifiedName("Edm", "String")); + CsdlTypeDefinition typeDefinition = + new CsdlTypeDefinition().setName(FQN.getName()).setUnderlyingType(new FullQualifiedName("Edm", "String")); when(provider.getTypeDefinition(FQN)).thenReturn(typeDefinition); - EntityType entityType = new EntityType().setName(FQN.getName()).setKey(new ArrayList()); + CsdlEntityType entityType = new CsdlEntityType().setName(FQN.getName()).setKey(new ArrayList()); when(provider.getEntityType(FQN)).thenReturn(entityType); - ComplexType complexType = new ComplexType().setName(FQN.getName()); + CsdlComplexType complexType = new CsdlComplexType().setName(FQN.getName()); when(provider.getComplexType(FQN)).thenReturn(complexType); - List aliasInfos = new ArrayList(); - aliasInfos.add(new AliasInfo().setAlias("alias").setNamespace("namespace")); + List aliasInfos = new ArrayList(); + aliasInfos.add(new CsdlAliasInfo().setAlias("alias").setNamespace("namespace")); when(provider.getAliasInfos()).thenReturn(aliasInfos); edm = new EdmProviderImpl(provider); @@ -86,7 +86,7 @@ public class EdmProviderImplTest { @Test public void nothingSpecifiedMustNotResultInExceptions() throws Exception { - EdmProvider localProvider = mock(EdmProvider.class); + CsdlEdmProvider localProvider = mock(CsdlEdmProvider.class); when(localProvider.getActions(FQN)).thenReturn(null); when(localProvider.getFunctions(FQN)).thenReturn(null); Edm localEdm = new EdmProviderImpl(localProvider); @@ -103,7 +103,7 @@ public class EdmProviderImplTest { @Test public void convertExceptionsTest() throws Exception { - EdmProvider localProvider = mock(EdmProvider.class); + CsdlEdmProvider localProvider = mock(CsdlEdmProvider.class); FullQualifiedName fqn = new FullQualifiedName("namespace", "name"); when(localProvider.getEntityContainerInfo(fqn)).thenThrow(new ODataException("msg")); when(localProvider.getEnumType(fqn)).thenThrow(new ODataException("msg")); @@ -161,7 +161,7 @@ public class EdmProviderImplTest { @Test(expected = EdmException.class) public void convertExceptionsAliasTest() throws Exception { - EdmProvider localProvider = mock(EdmProvider.class); + CsdlEdmProvider localProvider = mock(CsdlEdmProvider.class); when(localProvider.getAliasInfos()).thenThrow(new ODataException("msg")); Edm localEdm = new EdmProviderImpl(localProvider); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java index e8cecee13..2d95ca78b 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java @@ -27,7 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.apache.olingo.commons.core.edm.EdmReturnTypeImpl; @@ -44,7 +44,7 @@ public class EdmReturnTypeImplTest { @Test public void primitiveReturnType() { - ReturnType providerType = new ReturnType().setType(new FullQualifiedName("Edm", "String")); + CsdlReturnType providerType = new CsdlReturnType().setType(new FullQualifiedName("Edm", "String")); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock(EdmProviderImpl.class), providerType); @@ -59,7 +59,8 @@ public class EdmReturnTypeImplTest { @Test public void primitiveCollectionReturnType() { - ReturnType providerType = new ReturnType().setType(new FullQualifiedName("Edm", "String")).setCollection(true); + CsdlReturnType providerType = new CsdlReturnType().setType( + new FullQualifiedName("Edm", "String")).setCollection(true); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock(EdmProviderImpl.class), providerType); @@ -69,7 +70,8 @@ public class EdmReturnTypeImplTest { @Test(expected = EdmException.class) public void invalidPrimitiveType() { - ReturnType providerType = new ReturnType().setType(new FullQualifiedName("Edm", "wrong")).setCollection(true); + CsdlReturnType providerType = new CsdlReturnType().setType( + new FullQualifiedName("Edm", "wrong")).setCollection(true); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock(EdmProviderImpl.class), providerType); typeImpl.getType(); } @@ -80,7 +82,7 @@ public class EdmReturnTypeImplTest { FullQualifiedName baseType = new FullQualifiedName("namespace", "type"); EdmComplexType edmType = mock(EdmComplexType.class); when(mock.getComplexType(baseType)).thenReturn(edmType); - ReturnType providerType = new ReturnType().setType(baseType); + CsdlReturnType providerType = new CsdlReturnType().setType(baseType); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock, providerType); EdmType returnedType = typeImpl.getType(); assertEquals(edmType, returnedType); @@ -92,7 +94,7 @@ public class EdmReturnTypeImplTest { FullQualifiedName baseType = new FullQualifiedName("namespace", "type"); EdmEntityType edmType = mock(EdmEntityType.class); when(mock.getEntityType(baseType)).thenReturn(edmType); - ReturnType providerType = new ReturnType().setType(baseType); + CsdlReturnType providerType = new CsdlReturnType().setType(baseType); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock, providerType); EdmType returnedType = typeImpl.getType(); assertEquals(edmType, returnedType); @@ -104,7 +106,7 @@ public class EdmReturnTypeImplTest { FullQualifiedName baseType = new FullQualifiedName("namespace", "type"); EdmEnumType edmType = mock(EdmEnumType.class); when(mock.getEnumType(baseType)).thenReturn(edmType); - ReturnType providerType = new ReturnType().setType(baseType); + CsdlReturnType providerType = new CsdlReturnType().setType(baseType); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock, providerType); EdmType returnedType = typeImpl.getType(); assertEquals(edmType, returnedType); @@ -116,7 +118,7 @@ public class EdmReturnTypeImplTest { FullQualifiedName baseType = new FullQualifiedName("namespace", "type"); EdmTypeDefinition edmType = mock(EdmTypeDefinition.class); when(mock.getTypeDefinition(baseType)).thenReturn(edmType); - ReturnType providerType = new ReturnType().setType(baseType); + CsdlReturnType providerType = new CsdlReturnType().setType(baseType); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock, providerType); EdmType returnedType = typeImpl.getType(); assertEquals(edmType, returnedType); @@ -124,7 +126,7 @@ public class EdmReturnTypeImplTest { @Test(expected = EdmException.class) public void invalidType() { - ReturnType providerType = new ReturnType().setType(new FullQualifiedName("wrong", "wrong")); + CsdlReturnType providerType = new CsdlReturnType().setType(new FullQualifiedName("wrong", "wrong")); EdmReturnType typeImpl = new EdmReturnTypeImpl(mock(EdmProviderImpl.class), providerType); typeImpl.getType(); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java index 9b082774f..6dddcfc64 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java @@ -43,23 +43,23 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.junit.Before; import org.junit.Test; @@ -71,7 +71,7 @@ public class EdmSchemaImplTest { @Before public void before() { - EdmProvider provider = new LocalProvider(); + CsdlEdmProvider provider = new LocalProvider(); edm = new EdmProviderImpl(provider); schema = edm.getSchemas().get(0); @@ -79,17 +79,17 @@ public class EdmSchemaImplTest { @Test public void initialSchemaTest() { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); edm = new EdmProviderImpl(provider); edm.getSchemas(); } @Test public void emptySchemaTest() throws Exception { - ArrayList schemas = new ArrayList(); - Schema providerSchema = new Schema(); + ArrayList schemas = new ArrayList(); + CsdlSchema providerSchema = new CsdlSchema(); schemas.add(providerSchema); - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); when(provider.getSchemas()).thenReturn(schemas); edm = new EdmProviderImpl(provider); edm.getSchemas(); @@ -205,157 +205,158 @@ public class EdmSchemaImplTest { assertTrue(container == edm.getEntityContainer(null)); } - private class LocalProvider extends AbstractEdmProvider { + private class LocalProvider extends CsdlAbstractEdmProvider { private static final String ALIAS = "alias"; private static final String NAMESPACE = "org.namespace"; @Override - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public List getActions(final FullQualifiedName actionName) throws ODataException { + public List getActions(final FullQualifiedName actionName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public List getFunctions(final FullQualifiedName functionName) throws ODataException { + public List getFunctions(final FullQualifiedName functionName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public Term getTerm(final FullQualifiedName termName) throws ODataException { + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, + final String functionImportName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public List getAliasInfos() throws ODataException { + public List getAliasInfos() throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } @Override - public List getSchemas() throws ODataException { - Schema providerSchema = new Schema(); + public List getSchemas() throws ODataException { + CsdlSchema providerSchema = new CsdlSchema(); providerSchema.setNamespace(NAMESPACE); providerSchema.setAlias(ALIAS); - EntityContainer container = new EntityContainer().setName("container"); + CsdlEntityContainer container = new CsdlEntityContainer().setName("container"); - List entitySets = new ArrayList(); - entitySets.add(new EntitySet().setName("entitySetName") + List entitySets = new ArrayList(); + entitySets.add(new CsdlEntitySet().setName("entitySetName") .setType(new FullQualifiedName(NAMESPACE, "entityType1"))); entitySets - .add(new EntitySet().setName("entitySetName2").setType(new FullQualifiedName(NAMESPACE, "entityType2"))); + .add(new CsdlEntitySet().setName("entitySetName2").setType(new FullQualifiedName(NAMESPACE, "entityType2"))); container.setEntitySets(entitySets); - List singletons = new ArrayList(); - singletons.add(new Singleton().setName("singletonName") + List singletons = new ArrayList(); + singletons.add(new CsdlSingleton().setName("singletonName") .setType(new FullQualifiedName(NAMESPACE, "entityType1"))); singletons - .add(new Singleton().setName("singletonName2").setType(new FullQualifiedName(NAMESPACE, "entityType2"))); + .add(new CsdlSingleton().setName("singletonName2").setType(new FullQualifiedName(NAMESPACE, "entityType2"))); container.setSingletons(singletons); - List actionImports = new ArrayList(); - actionImports.add(new ActionImport().setName("actionImportName").setAction( + List actionImports = new ArrayList(); + actionImports.add(new CsdlActionImport().setName("actionImportName").setAction( new FullQualifiedName(NAMESPACE, "action1"))); - actionImports.add(new ActionImport().setName("actionImportName2").setAction( + actionImports.add(new CsdlActionImport().setName("actionImportName2").setAction( new FullQualifiedName(NAMESPACE, "action2"))); container.setActionImports(actionImports); - List functionImports = new ArrayList(); - functionImports.add(new FunctionImport().setName("functionImportName").setFunction( + List functionImports = new ArrayList(); + functionImports.add(new CsdlFunctionImport().setName("functionImportName").setFunction( new FullQualifiedName(NAMESPACE, "function1"))); - functionImports.add(new FunctionImport().setName("functionImportName2").setFunction( + functionImports.add(new CsdlFunctionImport().setName("functionImportName2").setFunction( new FullQualifiedName(NAMESPACE, "function2"))); container.setFunctionImports(functionImports); providerSchema.setEntityContainer(container); - List typeDefinitions = new ArrayList(); - typeDefinitions.add(new TypeDefinition().setName("typeDefinition1").setUnderlyingType( + List typeDefinitions = new ArrayList(); + typeDefinitions.add(new CsdlTypeDefinition().setName("typeDefinition1").setUnderlyingType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeDefinitions.add(new TypeDefinition().setName("typeDefinition2").setUnderlyingType( + typeDefinitions.add(new CsdlTypeDefinition().setName("typeDefinition2").setUnderlyingType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); providerSchema.setTypeDefinitions(typeDefinitions); - List enumTypes = new ArrayList(); - enumTypes.add(new EnumType().setName("enumType1")); - enumTypes.add(new EnumType().setName("enumType2")); + List enumTypes = new ArrayList(); + enumTypes.add(new CsdlEnumType().setName("enumType1")); + enumTypes.add(new CsdlEnumType().setName("enumType2")); providerSchema.setEnumTypes(enumTypes); - List entityTypes = new ArrayList(); - entityTypes.add(new EntityType().setName("entityType1")); - entityTypes.add(new EntityType().setName("entityType2") + List entityTypes = new ArrayList(); + entityTypes.add(new CsdlEntityType().setName("entityType1")); + entityTypes.add(new CsdlEntityType().setName("entityType2") .setBaseType(new FullQualifiedName(NAMESPACE, "entityType1"))); providerSchema.setEntityTypes(entityTypes); - List complexTypes = new ArrayList(); - complexTypes.add(new ComplexType().setName("complexType1")); - complexTypes.add(new ComplexType().setName("complexType2").setBaseType( + List complexTypes = new ArrayList(); + complexTypes.add(new CsdlComplexType().setName("complexType1")); + complexTypes.add(new CsdlComplexType().setName("complexType2").setBaseType( new FullQualifiedName(NAMESPACE, "complexType1"))); providerSchema.setComplexTypes(complexTypes); - List actions = new ArrayList(); - actions.add(new Action().setName("action1")); - actions.add(new Action().setName("action2")); + List actions = new ArrayList(); + actions.add(new CsdlAction().setName("action1")); + actions.add(new CsdlAction().setName("action2")); providerSchema.setActions(actions); - List functions = new ArrayList(); - functions.add(new Function().setName("function1")); - functions.add(new Function().setName("function2")); + List functions = new ArrayList(); + functions.add(new CsdlFunction().setName("function1")); + functions.add(new CsdlFunction().setName("function2")); providerSchema.setFunctions(functions); - ArrayList schemas = new ArrayList(); + ArrayList schemas = new ArrayList(); schemas.add(providerSchema); return schemas; } @Override - public EntityContainer getEntityContainer() throws ODataException { + public CsdlEntityContainer getEntityContainer() throws ODataException { throw new RuntimeException("Provider must not be called in the schema case"); } } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java index f502e20ee..d1aeb20e7 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java @@ -31,12 +31,12 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; import org.apache.olingo.commons.core.edm.EdmEntityContainerImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.apache.olingo.commons.core.edm.EdmSingletonImpl; @@ -46,28 +46,28 @@ public class EdmSingletonImplTest { @Test public void singleton() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName typeName = new FullQualifiedName("ns", "entityType"); - final EntityType entityTypeProvider = new EntityType() + final CsdlEntityType entityTypeProvider = new CsdlEntityType() .setName(typeName.getName()) - .setKey(Arrays.asList(new PropertyRef().setName("Id"))); + .setKey(Arrays.asList(new CsdlPropertyRef().setName("Id"))); when(provider.getEntityType(typeName)).thenReturn(entityTypeProvider); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); - final EntityContainerInfo containerInfo = new EntityContainerInfo().setContainerName(containerName); + final CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(containerName); when(provider.getEntityContainerInfo(containerName)).thenReturn(containerInfo); final EdmEntityContainer entityContainer = new EdmEntityContainerImpl(edm, provider, containerInfo); final String singletonName = "singleton"; - final Singleton singletonProvider = - new Singleton() + final CsdlSingleton singletonProvider = + new CsdlSingleton() .setName(singletonName) .setType(typeName) .setNavigationPropertyBindings( Arrays.asList( - new NavigationPropertyBinding().setPath("path").setTarget( + new CsdlNavigationPropertyBinding().setPath("path").setTarget( containerName.getFullQualifiedNameAsString() + "/" + singletonName))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); @@ -85,17 +85,17 @@ public class EdmSingletonImplTest { @Test(expected = EdmException.class) public void wrongTarget() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); - final EntityContainerInfo containerInfo = new EntityContainerInfo().setContainerName(containerName); + final CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(containerName); when(provider.getEntityContainerInfo(containerName)).thenReturn(containerInfo); final String singletonName = "singleton"; - final Singleton singletonProvider = new Singleton() + final CsdlSingleton singletonProvider = new CsdlSingleton() .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding().setPath("path") + new CsdlNavigationPropertyBinding().setPath("path") .setTarget(containerName.getFullQualifiedNameAsString() + "/wrong"))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); @@ -105,14 +105,14 @@ public class EdmSingletonImplTest { @Test(expected = EdmException.class) public void wrongTargetContainer() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); final String singletonName = "singleton"; - final Singleton singletonProvider = new Singleton() + final CsdlSingleton singletonProvider = new CsdlSingleton() .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding().setPath("path").setTarget("ns.wrongContainer/" + singletonName))); + new CsdlNavigationPropertyBinding().setPath("path").setTarget("ns.wrongContainer/" + singletonName))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); final EdmSingleton singleton = new EdmSingletonImpl(edm, null, singletonProvider); @@ -121,10 +121,10 @@ public class EdmSingletonImplTest { @Test(expected = EdmException.class) public void nonExsistingEntityType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); - Singleton singleton = new Singleton().setName("name"); + CsdlSingleton singleton = new CsdlSingleton().setName("name"); final EdmSingleton edmSingleton = new EdmSingletonImpl(edm, null, singleton); edmSingleton.getEntityType(); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java index 845dea7ba..cf610c39e 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java @@ -23,7 +23,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.apache.olingo.commons.core.edm.EdmProviderImpl; import org.apache.olingo.commons.core.edm.EdmTypeDefinitionImpl; @@ -39,8 +39,8 @@ public class EdmTypeDefinitionImplTest { @Test public void typeDefOnStringNoFacets() throws Exception { final FullQualifiedName typeDefName = new FullQualifiedName("namespace", "name"); - final TypeDefinition providerTypeDef = - new TypeDefinition().setName("typeDef").setUnderlyingType(new FullQualifiedName("Edm", "String")); + final CsdlTypeDefinition providerTypeDef = + new CsdlTypeDefinition().setName("typeDef").setUnderlyingType(new FullQualifiedName("Edm", "String")); final EdmTypeDefinition typeDefImpl = new EdmTypeDefinitionImpl(mock(EdmProviderImpl.class), typeDefName, providerTypeDef); @@ -68,8 +68,8 @@ public class EdmTypeDefinitionImplTest { @Test(expected = EdmException.class) public void invalidTypeResultsInEdmException() throws Exception { FullQualifiedName typeDefName = new FullQualifiedName("namespace", "name"); - TypeDefinition providerTypeDef = - new TypeDefinition().setName("typeDef").setUnderlyingType(new FullQualifiedName("wrong", "wrong")); + CsdlTypeDefinition providerTypeDef = + new CsdlTypeDefinition().setName("typeDef").setUnderlyingType(new FullQualifiedName("wrong", "wrong")); EdmTypeDefinitionImpl def = new EdmTypeDefinitionImpl(mock(EdmProviderImpl.class), typeDefName, providerTypeDef); def.getUnderlyingType(); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeImplTest.java index 5249de74d..c440c9d7a 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeImplTest.java @@ -22,8 +22,8 @@ import org.apache.olingo.commons.api.edm.EdmAnnotatable; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Annotatable; -import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; import org.apache.olingo.commons.core.edm.EdmTypeImpl; import org.junit.Test; @@ -51,10 +51,10 @@ public class EdmTypeImplTest { } } - private class AnnoTester implements Annotatable { + private class AnnoTester implements CsdlAnnotatable { @Override - public List getAnnotations() { - Annotation annotation = new Annotation(); + public List getAnnotations() { + CsdlAnnotation annotation = new CsdlAnnotation(); annotation.setTerm("NS.SimpleTerm"); return Arrays.asList(annotation); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java index 43333089e..567e3a528 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java @@ -28,36 +28,36 @@ import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; import org.apache.olingo.commons.core.edm.EdmComplexTypeImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; public class ComplexTypeHelper { public static EdmComplexType createType() throws ODataException { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); - ComplexType baseComplexType = new ComplexType(); - List baseProperties = new ArrayList(); - baseProperties.add(new Property().setName("prop1").setType( + CsdlComplexType baseComplexType = new CsdlComplexType(); + List baseProperties = new ArrayList(); + baseProperties.add(new CsdlProperty().setName("prop1").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - List baseNavigationProperties = new ArrayList(); - baseNavigationProperties.add(new NavigationProperty().setName("nav1")); + List baseNavigationProperties = new ArrayList(); + baseNavigationProperties.add(new CsdlNavigationProperty().setName("nav1")); baseComplexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(baseProperties) .setNavigationProperties(baseNavigationProperties); when(provider.getComplexType(baseName)).thenReturn(baseComplexType); FullQualifiedName name = new FullQualifiedName("namespace", "typeName"); - ComplexType complexType = new ComplexType().setBaseType(baseName); - List properties = new ArrayList(); - properties.add(new Property().setName("prop2").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - List navigationProperties = new ArrayList(); - navigationProperties.add(new NavigationProperty().setName("nav2")); + CsdlComplexType complexType = new CsdlComplexType().setBaseType(baseName); + List properties = new ArrayList(); + properties.add(new CsdlProperty().setName("prop2").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + List navigationProperties = new ArrayList(); + navigationProperties.add(new CsdlNavigationProperty().setName("nav2")); complexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(properties) .setNavigationProperties(navigationProperties); when(provider.getComplexType(name)).thenReturn(complexType); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java index af5b42149..df4ed778d 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java @@ -33,10 +33,10 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; import org.apache.olingo.commons.core.edm.primitivetype.EdmString; import org.apache.olingo.commons.core.edm.EdmComplexTypeImpl; import org.apache.olingo.commons.core.edm.EdmProviderImpl; @@ -175,16 +175,16 @@ public class ContextURLBuilderTest { @Test public void buildComplexType() throws Exception { - EdmProvider provider = mock(EdmProvider.class); + CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); - ComplexType baseComplexType = new ComplexType(); - List baseProperties = new ArrayList(); - baseProperties.add(new Property().setName("prop1").setType( + CsdlComplexType baseComplexType = new CsdlComplexType(); + List baseProperties = new ArrayList(); + baseProperties.add(new CsdlProperty().setName("prop1").setType( EdmPrimitiveTypeKind.String.getFullQualifiedName())); - List baseNavigationProperties = new ArrayList(); - baseNavigationProperties.add(new NavigationProperty().setName("nav1")); + List baseNavigationProperties = new ArrayList(); + baseNavigationProperties.add(new CsdlNavigationProperty().setName("nav1")); baseComplexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(baseProperties) .setNavigationProperties(baseNavigationProperties); when(provider.getComplexType(baseName)).thenReturn(baseComplexType); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java index d1b73f71b..560685bce 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java @@ -38,25 +38,25 @@ import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumMember; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.ReturnType; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.core.edm.EdmComplexTypeImpl; import org.apache.olingo.server.api.OData; @@ -212,7 +212,7 @@ public class MetadataDocumentXmlSerializerTest { @Test public void aliasTest() throws Exception { - EdmProvider provider = new LocalProvider(); + CsdlEdmProvider provider = new LocalProvider(); ServiceMetadata serviceMetadata = new ServiceMetadataImpl(provider, Collections. emptyList()); InputStream metadataStream = serializer.metadataDocument(serviceMetadata).getContent(); String metadata = IOUtils.toString(metadataStream); @@ -240,14 +240,14 @@ public class MetadataDocumentXmlSerializerTest { List complexTypes = new ArrayList(); FullQualifiedName name = new FullQualifiedName("namespace", "ComplexType"); - ComplexType complexType = new ComplexType(); + CsdlComplexType complexType = new CsdlComplexType(); complexType.setAbstract(true); complexType.setName(name.getName()); complexType.setOpenType(true); - List properties = new ArrayList(); + List properties = new ArrayList(); - properties.add(new Property().setName("prop1").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - properties.add(new Property().setName("prop2").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + properties.add(new CsdlProperty().setName("prop1").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + properties.add(new CsdlProperty().setName("prop2").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); complexType.setProperties(properties); EdmComplexTypeImpl c1 = new EdmComplexTypeImpl(edm, name, complexType); @@ -263,7 +263,7 @@ public class MetadataDocumentXmlSerializerTest { + "")); } - private class LocalProvider extends AbstractEdmProvider { + private class LocalProvider extends CsdlAbstractEdmProvider { private final static String nameSpace = "namespace"; private final FullQualifiedName nameETAbstract = new FullQualifiedName(nameSpace, "ETAbstract"); @@ -272,11 +272,11 @@ public class MetadataDocumentXmlSerializerTest { private final FullQualifiedName nameInt16 = EdmPrimitiveTypeKind.Int16.getFullQualifiedName(); private final FullQualifiedName nameString = EdmPrimitiveTypeKind.String.getFullQualifiedName(); private final FullQualifiedName nameUARTPrimParam = new FullQualifiedName(nameSpace, "UARTPrimParam"); - private final Property propertyInt16_NotNullable = new Property() + private final CsdlProperty propertyInt16_NotNullable = new CsdlProperty() .setName("PropertyInt16") .setType(nameInt16) .setNullable(false); - private final Property propertyString = new Property() + private final CsdlProperty propertyString = new CsdlProperty() .setName("PropertyString") .setType(nameString); @@ -287,35 +287,35 @@ public class MetadataDocumentXmlSerializerTest { private final FullQualifiedName nameENString = new FullQualifiedName(nameSpace, "ENString"); @Override - public List getAliasInfos() throws ODataException { + public List getAliasInfos() throws ODataException { return Arrays.asList( - new AliasInfo().setAlias("Alias").setNamespace(nameSpace) + new CsdlAliasInfo().setAlias("Alias").setNamespace(nameSpace) ); } @Override - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { - return new EnumType() + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + return new CsdlEnumType() .setName("ENString") .setFlags(true) .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()) .setMembers(Arrays.asList( - new EnumMember().setName("String1").setValue("1"))); + new CsdlEnumMember().setName("String1").setValue("1"))); } @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { if (entityTypeName.equals(nameETAbstract)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAbstract") .setAbstract(true) .setProperties(Arrays.asList(propertyString)); } else if (entityTypeName.equals(nameETAbstractBase)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAbstractBase") .setBaseType(nameETAbstract) - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( propertyInt16_NotNullable)); } @@ -323,15 +323,15 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { if (complexTypeName.equals(nameCTTwoPrim)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTTwoPrim") .setProperties(Arrays.asList(propertyInt16_NotNullable, propertyString)); } if (complexTypeName.equals(nameCTTwoPrimBase)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTTwoPrimBase") .setBaseType(nameCTTwoPrim) .setProperties(Arrays.asList(propertyInt16_NotNullable, propertyString)); @@ -342,14 +342,14 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public List getActions(final FullQualifiedName actionName) throws ODataException { + public List getActions(final FullQualifiedName actionName) throws ODataException { if (actionName.equals(nameUARTPrimParam)) { return Arrays.asList( - new Action().setName("UARTPrimParam") + new CsdlAction().setName("UARTPrimParam") .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setType(nameInt16))) + new CsdlParameter().setName("ParameterInt16").setType(nameInt16))) - .setReturnType(new ReturnType().setType(nameString)) + .setReturnType(new CsdlReturnType().setType(nameString)) ); } @@ -357,14 +357,14 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public List getFunctions(final FullQualifiedName functionName) throws ODataException { + public List getFunctions(final FullQualifiedName functionName) throws ODataException { if (functionName.equals(nameUFNRTInt16)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFNRTInt16") - .setParameters(new ArrayList()) + .setParameters(new ArrayList()) .setReturnType( - new ReturnType().setType(nameInt16)) + new CsdlReturnType().setType(nameInt16)) ); } @@ -372,10 +372,10 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { if (entitySetName.equals("ESAllPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESAllPrim") .setType(nameETAbstractBase); @@ -384,10 +384,10 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) throws ODataException { if (singletonName.equals("SI")) { - return new Singleton() + return new CsdlSingleton() .setName("SI") .setType(nameETAbstractBase); @@ -396,11 +396,11 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) throws ODataException { if (entityContainer.equals(nameContainer)) { if (actionImportName.equals("AIRTPrimParam")) { - return new ActionImport() + return new CsdlActionImport() .setName("AIRTPrimParam") .setAction(nameUARTPrimParam); @@ -410,11 +410,12 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, + final String functionImportName) throws ODataException { if (entityContainer.equals(nameContainer)) { if (functionImportName.equals("FINRTInt16")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName("FINRTInt16") .setFunction(nameUFNRTInt16) .setIncludeInServiceDocument(true); @@ -425,25 +426,25 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public List getSchemas() throws ODataException { - List schemas = new ArrayList(); - Schema schema = new Schema(); + public List getSchemas() throws ODataException { + List schemas = new ArrayList(); + CsdlSchema schema = new CsdlSchema(); schema.setNamespace(nameSpace); schema.setAlias("Alias"); schemas.add(schema); // EnumTypes - List enumTypes = new ArrayList(); + List enumTypes = new ArrayList(); schema.setEnumTypes(enumTypes); enumTypes.add(getEnumType(nameENString)); // EntityTypes - List entityTypes = new ArrayList(); + List entityTypes = new ArrayList(); schema.setEntityTypes(entityTypes); entityTypes.add(getEntityType(nameETAbstract)); entityTypes.add(getEntityType(nameETAbstractBase)); // ComplexTypes - List complexType = new ArrayList(); + List complexType = new ArrayList(); schema.setComplexTypes(complexType); complexType.add(getComplexType(nameCTTwoPrim)); complexType.add(getComplexType(nameCTTwoPrimBase)); @@ -451,12 +452,12 @@ public class MetadataDocumentXmlSerializerTest { // TypeDefinitions // Actions - List actions = new ArrayList(); + List actions = new ArrayList(); schema.setActions(actions); actions.addAll(getActions(nameUARTPrimParam)); // Functions - List functions = new ArrayList(); + List functions = new ArrayList(); schema.setFunctions(functions); functions.addAll(getFunctions(nameUFNRTInt16)); @@ -468,27 +469,27 @@ public class MetadataDocumentXmlSerializerTest { } @Override - public EntityContainer getEntityContainer() throws ODataException { - EntityContainer container = new EntityContainer(); + public CsdlEntityContainer getEntityContainer() throws ODataException { + CsdlEntityContainer container = new CsdlEntityContainer(); container.setName("container"); // EntitySets - List entitySets = new ArrayList(); + List entitySets = new ArrayList(); container.setEntitySets(entitySets); entitySets.add(getEntitySet(nameContainer, "ESAllPrim")); // Singletons - List singletons = new ArrayList(); + List singletons = new ArrayList(); container.setSingletons(singletons); singletons.add(getSingleton(nameContainer, "SI")); // ActionImports - List actionImports = new ArrayList(); + List actionImports = new ArrayList(); container.setActionImports(actionImports); actionImports.add(getActionImport(nameContainer, "AIRTPrimParam")); // FunctionImports - List functionImports = new ArrayList(); + List functionImports = new ArrayList(); container.setFunctionImports(functionImports); functionImports.add(getFunctionImport(nameContainer, "FINRTInt16")); diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java index 64263274a..a7ecb9fca 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java @@ -24,9 +24,9 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; public class ActionProvider { @@ -79,176 +79,176 @@ public class ActionProvider { new FullQualifiedName(SchemaProvider.NAMESPACE, "UARTTwoParam"); - public List getActions(final FullQualifiedName actionName) throws ODataException { + public List getActions(final FullQualifiedName actionName) throws ODataException { if (actionName.equals(nameUARTString)) { return Collections.singletonList( - new Action().setName(nameUARTString.getName()) - .setReturnType(new ReturnType().setType(PropertyProvider.nameString))); + new CsdlAction().setName(nameUARTString.getName()) + .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameString))); } else if (actionName.equals(nameUARTCollStringTwoParam)) { return Collections.singletonList( - new Action().setName(nameUARTCollStringTwoParam.getName()) + new CsdlAction().setName(nameUARTCollStringTwoParam.getName()) .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16), - new Parameter().setName("ParameterDuration").setType(PropertyProvider.nameDuration))) - .setReturnType(new ReturnType().setType(PropertyProvider.nameString).setCollection(true))); + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16), + new CsdlParameter().setName("ParameterDuration").setType(PropertyProvider.nameDuration))) + .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameString).setCollection(true))); } else if (actionName.equals(nameUARTCTTwoPrimParam)) { return Collections.singletonList( - new Action().setName(nameUARTCTTwoPrimParam.getName()) + new CsdlAction().setName(nameUARTCTTwoPrimParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16) + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16) .setNullable(false))) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))); + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))); } else if (actionName.equals(nameUARTCollCTTwoPrimParam)) { return Collections.singletonList( - new Action().setName(nameUARTCollCTTwoPrimParam.getName()) + new CsdlAction().setName(nameUARTCollCTTwoPrimParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true))); + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true))); } else if (actionName.equals(nameUARTETTwoKeyTwoPrimParam)) { return Collections.singletonList( - new Action().setName(nameUARTETTwoKeyTwoPrimParam.getName()) + new CsdlAction().setName(nameUARTETTwoKeyTwoPrimParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyTwoPrim))); + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyTwoPrim))); } else if (actionName.equals(nameUARTCollETKeyNavParam)) { return Collections.singletonList( - new Action().setName(nameUARTCollETKeyNavParam.getName()) + new CsdlAction().setName(nameUARTCollETKeyNavParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16))) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))); + new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))); } else if (actionName.equals(nameUARTETAllPrimParam)) { return Collections.singletonList( - new Action().setName(nameUARTETAllPrimParam.getName()) + new CsdlAction().setName(nameUARTETAllPrimParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterDate").setType(PropertyProvider.nameDate))) + new CsdlParameter().setName("ParameterDate").setType(PropertyProvider.nameDate))) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETAllPrim))); + new CsdlReturnType().setType(EntityTypeProvider.nameETAllPrim))); } else if (actionName.equals(nameUARTCollETAllPrimParam)) { return Collections.singletonList( - new Action().setName(nameUARTCollETAllPrimParam.getName()) + new CsdlAction().setName(nameUARTCollETAllPrimParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterTimeOfDay") + new CsdlParameter().setName("ParameterTimeOfDay") .setType(PropertyProvider.nameTimeOfDay))) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true))); + new CsdlReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true))); } else if (actionName.equals(nameUART)) { - return Collections.singletonList(new Action().setName(nameUART.getName())); + return Collections.singletonList(new CsdlAction().setName(nameUART.getName())); } else if (actionName.equals(nameUARTParam)) { return Collections.singletonList( - new Action() + new CsdlAction() .setName(nameUARTParam.getName()) .setParameters(Collections.singletonList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))); + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))); } else if (actionName.equals(nameUARTTwoParam)) { return Collections.singletonList( - new Action() + new CsdlAction() .setName(nameUARTTwoParam.getName()) .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16), - new Parameter().setName("ParameterDuration").setType(PropertyProvider.nameDuration)))); + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16), + new CsdlParameter().setName("ParameterDuration").setType(PropertyProvider.nameDuration)))); } else if (actionName.equals(nameBAETTwoKeyNavRTETTwoKeyNav)) { return Arrays.asList( - new Action().setName("BAETTwoKeyNavRTETTwoKeyNav") + new CsdlAction().setName("BAETTwoKeyNavRTETTwoKeyNav") .setParameters(Arrays.asList( - new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav) .setNullable(false))) .setBound(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav)) , - new Action().setName("BAETTwoKeyNavRTETTwoKeyNav") + new CsdlAction().setName("BAETTwoKeyNavRTETTwoKeyNav") .setParameters(Arrays.asList( - new Parameter().setName("ParameterETKeyNav").setType(EntityTypeProvider.nameETKeyNav) + new CsdlParameter().setName("ParameterETKeyNav").setType(EntityTypeProvider.nameETKeyNav) .setNullable(false))) .setBound(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav)) ); } else if (actionName.equals(nameBAESAllPrimRTETAllPrim)) { return Arrays.asList( - new Action().setName("BAESAllPrimRTETAllPrim") + new CsdlAction().setName("BAESAllPrimRTETAllPrim") .setParameters(Arrays.asList( - new Parameter().setName("ParameterESAllPrim").setType(EntityTypeProvider.nameETAllPrim) + new CsdlParameter().setName("ParameterESAllPrim").setType(EntityTypeProvider.nameETAllPrim) .setCollection(true).setNullable(false))) .setBound(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETAllPrim))); + new CsdlReturnType().setType(EntityTypeProvider.nameETAllPrim))); } else if (actionName.equals(nameBAESTwoKeyNavRTESTwoKeyNav)) { return Arrays.asList( - new Action().setName("BAESTwoKeyNavRTESTwoKeyNav") + new CsdlAction().setName("BAESTwoKeyNavRTESTwoKeyNav") .setParameters(Arrays.asList( - new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setBound(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true))); + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true))); } else if(actionName.equals(nameBAESTwoKeyNavRTESKeyNav)) { return Arrays.asList( - new Action().setName("BAESTwoKeyNavRTESKeyNav") + new CsdlAction().setName("BAESTwoKeyNavRTESKeyNav") .setBound(true) .setEntitySetPath("BindingParam/NavPropertyETKeyNavMany") .setParameters(Arrays.asList( - new Parameter().setName("ParameterETTwoKeyNav") + new CsdlParameter().setName("ParameterETTwoKeyNav") .setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true) .setNullable(false))) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))); + new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))); } else if (actionName.equals(nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav)) { return Arrays.asList( - new Action().setName("BAETBaseTwoKeyNavRTETBaseTwoKeyNav") + new CsdlAction().setName("BAETBaseTwoKeyNavRTETBaseTwoKeyNav") .setParameters(Arrays.asList( - new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETBaseTwoKeyNav) + new CsdlParameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setNullable(false))) .setBound(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))); + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))); } else if (actionName.equals(nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav)) { return Arrays.asList( - new Action().setName("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav") + new CsdlAction().setName("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav") .setParameters(Arrays.asList( - new Parameter().setName("ParameterETTwoBaseTwoKeyNav") + new CsdlParameter().setName("ParameterETTwoBaseTwoKeyNav") .setType(EntityTypeProvider.nameETTwoBaseTwoKeyNav) .setNullable(false))) .setBound(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav))); + new CsdlReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav))); } else if(actionName.equals(nameBAETAllPrimRT)) { return Arrays.asList( - new Action().setName("BAETAllPrimRT") + new CsdlAction().setName("BAETAllPrimRT") .setBound(true) .setParameters(Arrays.asList( - new Parameter().setName("ParameterETAllPrim") + new CsdlParameter().setName("ParameterETAllPrim") .setNullable(false) .setType(EntityTypeProvider.nameETAllPrim) ))); } else if(actionName.equals(nameBAESAllPrimRT)) { return Arrays.asList( - new Action().setName("BAESAllPrimRT") + new CsdlAction().setName("BAESAllPrimRT") .setBound(true) .setParameters(Arrays.asList( - new Parameter().setName("ParameterETAllPrim") + new CsdlParameter().setName("ParameterETAllPrim") .setNullable(false) .setCollection(true) .setType(EntityTypeProvider.nameETAllPrim) diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java index b8b489517..819c19f2c 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java @@ -23,9 +23,9 @@ import java.util.Arrays; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; public class ComplexTypeProvider { @@ -54,15 +54,15 @@ public class ComplexTypeProvider { "CTMixEnumDef"); public static final FullQualifiedName nameCTNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE, "CTNavCont"); - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { if (complexTypeName.equals(nameCTPrim)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTPrim") .setProperties(Arrays.asList(PropertyProvider.propertyInt16)); } else if (complexTypeName.equals(nameCTAllPrim)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTAllPrim") .setProperties( Arrays.asList(PropertyProvider.propertyString, PropertyProvider.propertyBinary, @@ -73,7 +73,7 @@ public class ComplexTypeProvider { PropertyProvider.propertyInt64, PropertyProvider.propertySByte, PropertyProvider.propertyTimeOfDay_Precision)); } else if (complexTypeName.equals(nameCTCollAllPrim)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTCollAllPrim") .setProperties( Arrays.asList( @@ -88,72 +88,72 @@ public class ComplexTypeProvider { )); } else if (complexTypeName.equals(nameCTTwoPrim)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTTwoPrim") .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable)); } else if (complexTypeName.equals(nameCTCompNav)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTCompNav") .setProperties(Arrays.asList(PropertyProvider.propertyString, PropertyProvider.propertyCompNav_CTNavFiveProp)); } else if (complexTypeName.equals(nameCTMixPrimCollComp)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTMixPrimCollComp") .setProperties( Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.collPropertyString, PropertyProvider.propertyComp_CTTwoPrim, PropertyProvider.collPropertyComp_CTTwoPrim)); } else if (complexTypeName.equals(nameCTBase)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTBase") .setBaseType(nameCTTwoPrim) .setProperties(Arrays.asList( - new Property() + new CsdlProperty() .setName("AdditionalPropString") .setType(new FullQualifiedName("Edm", "String")))); } else if (complexTypeName.equals(nameCTTwoBase)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTTwoBase") .setBaseType(nameCTBase); } else if (complexTypeName.equals(nameCTCompComp)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTCompComp") .setProperties(Arrays.asList(PropertyProvider.propertyComp_CTTwoPrim)); } else if (complexTypeName.equals(nameCTCompCollComp)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTCompCollComp") .setProperties(Arrays.asList(PropertyProvider.collPropertyComp_CTTwoPrim)); } else if (complexTypeName.equals(nameCTPrimComp)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTPrimComp") .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyComp_CTAllPrim)); } else if (complexTypeName.equals(nameCTNavFiveProp)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTNavFiveProp") .setProperties(Arrays.asList(PropertyProvider.propertyInt16)) .setNavigationProperties((Arrays.asList( PropertyProvider.collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav, PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav_WithPartnerERKeyNavOne, - new NavigationProperty() + new CsdlNavigationProperty() .setName("NavPropertyETMediaOne") .setType(EntityTypeProvider.nameETMedia), - new NavigationProperty() + new CsdlNavigationProperty() .setName("NavPropertyETMediaMany") .setType(EntityTypeProvider.nameETMedia).setCollection(true) ))); } else if (complexTypeName.equals(nameCTNavCont)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTNavCont") - .setProperties(new ArrayList()) + .setProperties(new ArrayList()) .setNavigationProperties(Arrays.asList( PropertyProvider.collectionNavPropertyETKeyNavContMany_CT_ETKeyNav, PropertyProvider.navPropertyETKeyNavContOne_CT_ETeyNav, @@ -161,7 +161,7 @@ public class ComplexTypeProvider { PropertyProvider.navPropertyETTwoKeyNavContOne_CT_ETKeyNav)); } else if (complexTypeName.equals(nameCTBasePrimCompNav)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTBasePrimCompNav") .setBaseType(nameCTPrimComp) .setNavigationProperties(Arrays.asList( @@ -171,12 +171,12 @@ public class ComplexTypeProvider { PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav)); } else if (complexTypeName.equals(nameCTTwoBasePrimCompNav)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTTwoBasePrimCompNav") .setBaseType(nameCTBasePrimCompNav); } else if (complexTypeName.equals(nameCTMixEnumDef)) { - return new ComplexType() + return new CsdlComplexType() .setName(nameCTMixEnumDef.getName()) .setProperties(Arrays.asList( PropertyProvider.propertyEnumString_ENString_Nullable, diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java index 9b982aa22..1f5bd03e1 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java @@ -24,13 +24,13 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; public class ContainerProvider { @@ -47,8 +47,8 @@ public class ContainerProvider { public static final String AIRT_PARAM = "AIRTParam"; public static final String AIRT_TWO_PARAM = "AIRTTwoParam"; - EntityContainerInfo entityContainerInfoTest1 = - new EntityContainerInfo().setContainerName(nameContainer); + CsdlEntityContainerInfo entityContainerInfoTest1 = + new CsdlEntityContainerInfo().setContainerName(nameContainer); private EdmTechProvider prov; @@ -56,7 +56,8 @@ public class ContainerProvider { prov = edmTechProvider; } - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException { if (entityContainerName == null) { return entityContainerInfoTest1; } else if (entityContainerName.equals(nameContainer)) { @@ -66,12 +67,12 @@ public class ContainerProvider { return null; } - public EntityContainer getEntityContainer() throws ODataException { - EntityContainer container = new EntityContainer(); + public CsdlEntityContainer getEntityContainer() throws ODataException { + CsdlEntityContainer container = new CsdlEntityContainer(); container.setName(ContainerProvider.nameContainer.getName()); // EntitySets - List entitySets = new ArrayList(); + List entitySets = new ArrayList(); container.setEntitySets(entitySets); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllPrim")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCollAllPrim")); @@ -100,16 +101,16 @@ public class ContainerProvider { entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixEnumDefCollComp")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBaseTwoKeyNav")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNavCont")); - + // Singletons - List singletons = new ArrayList(); + List singletons = new ArrayList(); container.setSingletons(singletons); singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SI")); singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SINav")); singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SIMedia")); // ActionImports - List actionImports = new ArrayList(); + List actionImports = new ArrayList(); container.setActionImports(actionImports); actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AIRT_STRING)); actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AIRT_COLL_STRING_TWO_PARAM)); @@ -124,7 +125,7 @@ public class ContainerProvider { actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, AIRT_TWO_PARAM)); // FunctionImports - List functionImports = new ArrayList(); + List functionImports = new ArrayList(); container.setFunctionImports(functionImports); functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTInt16")); functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisibleRTInt16")); @@ -148,291 +149,291 @@ public class ContainerProvider { functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollESTwoKeyNavParam")); functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrimParam")); functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTCollCTNavFiveProp")); - functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollESKeyNavContParam")); - + functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollESKeyNavContParam")); + return container; } - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException { + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException { if (entityContainer == nameContainer) { if (name.equals("ESAllPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESAllPrim") .setType(EntityTypeProvider.nameETAllPrim) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoPrimOne") - .setTarget("ESTwoPrim"), - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoPrimMany") - .setTarget("ESTwoPrim") - )); + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoPrimOne") + .setTarget("ESTwoPrim"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoPrimMany") + .setTarget("ESTwoPrim") + )); } else if (name.equals("ESCollAllPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESCollAllPrim") .setType(EntityTypeProvider.nameETCollAllPrim); } else if (name.equals("ESTwoPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESTwoPrim") .setType(EntityTypeProvider.nameETTwoPrim) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() - .setPath("NavPropertyETAllPrimOne") - .setTarget("ESAllPrim"), - new NavigationPropertyBinding() - .setPath("NavPropertyETAllPrimMany") - .setTarget("ESAllPrim") - )); + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETAllPrimOne") + .setTarget("ESAllPrim"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETAllPrimMany") + .setTarget("ESAllPrim") + )); } else if (name.equals("ESMixPrimCollComp")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESMixPrimCollComp") .setType(EntityTypeProvider.nameETMixPrimCollComp); } else if (name.equals("ESBase")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESBase") .setType(EntityTypeProvider.nameETBase); } else if (name.equals("ESTwoBase")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESTwoBase") .setType(EntityTypeProvider.nameETTwoBase); } else if (name.equals("ESTwoKeyTwoPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESTwoKeyTwoPrim") .setType(EntityTypeProvider.nameETTwoKeyTwoPrim); } else if (name.equals("ESBaseTwoKeyTwoPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESBaseTwoKeyTwoPrim") .setType(EntityTypeProvider.nameETBaseTwoKeyTwoPrim); } else if (name.equals("ESTwoBaseTwoKeyTwoPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESTwoBaseTwoKeyTwoPrim") .setType(EntityTypeProvider.nameETTwoBaseTwoKeyTwoPrim); } else if (name.equals("ESAllKey")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESAllKey") .setType(EntityTypeProvider.nameETAllKey); } else if (name.equals("ESCompAllPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESCompAllPrim") .setType(EntityTypeProvider.nameETCompAllPrim); } else if (name.equals("ESCompCollAllPrim")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESCompCollAllPrim") .setType(EntityTypeProvider.nameETCompCollAllPrim); } else if (name.equals("ESCompComp")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESCompComp") .setType(EntityTypeProvider.nameETCompComp); } else if (name.equals("ESCompCollComp")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESCompCollComp") .setType(EntityTypeProvider.nameETCompCollComp); } else if (name.equals("ESMedia")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESMedia") .setType(EntityTypeProvider.nameETMedia) .setIncludeInServiceDocument(true); } else if (name.equals("ESKeyTwoKeyComp")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESKeyTwoKeyComp") .setType(EntityTypeProvider.nameETKeyTwoKeyComp); } else if (name.equals("ESInvisible")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESInvisible") .setIncludeInServiceDocument(false) .setType(EntityTypeProvider.nameETAllPrim); } else if (name.equals("ESServerSidePaging")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESServerSidePaging") .setType(EntityTypeProvider.nameETServerSidePaging); } else if (name.equals("ESAllNullable")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESAllNullable") .setType(EntityTypeProvider.nameETAllNullable); } else if (name.equals("ESKeyNav")) { - - return new EntitySet() + + return new CsdlEntitySet() .setName("ESKeyNav") .setType(EntityTypeProvider.nameETKeyNav) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() - .setPath("NavPropertyETKeyNavOne") - .setTarget("ESKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETKeyNavMany") - .setTarget("ESKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoKeyNavOne") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETMediaOne") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("NavPropertyETMediaMany") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETMediaOne") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETMediaMany") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETMediaOne") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETMediaMany") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("ETKeyNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("ETKeyNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/com.corp.odata.test1.CTNavFiveProp/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav") + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETKeyNavOne") + .setTarget("ESKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETKeyNavMany") + .setTarget("ESKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoKeyNavOne") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETMediaOne") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETMediaMany") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOne") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETMediaOne") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETMediaMany") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETTwoKeyNavOne") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETMediaOne") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETMediaMany") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("ETKeyNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("ETKeyNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/com.corp.odata.test1.CTNavFiveProp/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav") )); - + } else if (name.equals("ESTwoKeyNav")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESTwoKeyNav") .setType(EntityTypeProvider.nameETTwoKeyNav) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() - .setPath("NavPropertyETKeyNavOne") - .setTarget("ESKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETKeyNavMany") - .setTarget("ESKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoKeyNavOne") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETKeyNavOne") - .setTarget("ESKeyNav"), - new NavigationPropertyBinding() - .setPath("PropertyCompNav/NavPropertyETKeyNavMany") - .setTarget("ESKeyNav"), - new NavigationPropertyBinding() - .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("CollPropertyCompNav/NavPropertyETMediaOne") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("CollPropertyCompNav/NavPropertyETMediaMany") - .setTarget("ESMedia"), - new NavigationPropertyBinding() - .setPath("NavPropertyETTwoBaseTwoKeyNavOne") - .setTarget("ESBaseTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("ETBaseTwoKeyNav/CollPropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("ETBaseTwoKeyNav/NavPropertyETTwoBaseTwoKeyNavOne") - .setTarget("ESBaseTwoKeyNav"), - new NavigationPropertyBinding() - .setPath("NavPropertySINav") - .setTarget("SINav") - )); - - } else if(name.equals("ESKeyNavCont")) { - return new EntitySet() - .setName("ESKeyNavCont") - .setType(EntityTypeProvider.nameETKeyNavCont) - .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETKeyNavOne") + .setTarget("ESKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETKeyNavMany") + .setTarget("ESKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoKeyNavOne") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOne") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETKeyNavOne") + .setTarget("ESKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("PropertyCompNav/NavPropertyETKeyNavMany") + .setTarget("ESKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavOne") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("CollPropertyCompNav/NavPropertyETMediaOne") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("CollPropertyCompNav/NavPropertyETMediaMany") + .setTarget("ESMedia"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETTwoBaseTwoKeyNavOne") + .setTarget("ESBaseTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("ETBaseTwoKeyNav/CollPropertyCompNav/NavPropertyETTwoKeyNavMany") + .setTarget("ESTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("ETBaseTwoKeyNav/NavPropertyETTwoBaseTwoKeyNavOne") + .setTarget("ESBaseTwoKeyNav"), + new CsdlNavigationPropertyBinding() + .setPath("NavPropertySINav") + .setTarget("SINav") + )); + + } else if (name.equals("ESKeyNavCont")) { + return new CsdlEntitySet() + .setName("ESKeyNavCont") + .setType(EntityTypeProvider.nameETKeyNavCont) + .setNavigationPropertyBindings(Arrays.asList( + new CsdlNavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne") .setTarget("ESKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne") .setTarget("ESKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("PropertyCompNavCont/NavPropertyETKeyNavContMany/NavPropertyETKeyNavOne") .setTarget("ESKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("PropertyCompNavCont/NavPropertyETKeyNavContOne/NavPropertyETKeyNavOne") .setTarget("ESKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne") .setTarget("ESKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne") .setTarget("ESKeyNav") - )); + )); } else if (name.equals("ESBaseTwoKeyNav")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESBaseTwoKeyNav") .setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() - .setPath("NavPropertyETKeyNavMany") - .setTarget("ESKeyNav")) + new CsdlNavigationPropertyBinding() + .setPath("NavPropertyETKeyNavMany") + .setTarget("ESKeyNav")) ); - } else if(name.equals("ESTwoBaseTwoKeyNav")) { - return new EntitySet() - .setName("ESTwoBaseTwoKeyNav") - .setType(EntityTypeProvider.nameETTwoBaseTwoKeyNav); - + } else if (name.equals("ESTwoBaseTwoKeyNav")) { + return new CsdlEntitySet() + .setName("ESTwoBaseTwoKeyNav") + .setType(EntityTypeProvider.nameETTwoBaseTwoKeyNav); + } else if (name.equals("ESCompMixPrimCollComp")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESCompMixPrimCollComp") .setType(EntityTypeProvider.nameETCompMixPrimCollComp); } else if (name.equals("ESFourKeyAlias")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESFourKeyAlias") .setType(EntityTypeProvider.nameETFourKeyAlias); - + } else if (name.equals("ESMixEnumDefCollComp")) { - return new EntitySet().setName("ESMixEnumDefCollComp").setType( + return new CsdlEntitySet().setName("ESMixEnumDefCollComp").setType( EntityTypeProvider.nameETMixEnumDefCollComp); } } @@ -440,63 +441,63 @@ public class ContainerProvider { return null; } - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String name) + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String name) throws ODataException { if (entityContainer.equals(nameContainer)) { if (name.equals(AIRT_STRING)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_STRING) .setAction(ActionProvider.nameUARTString); } else if (name.equals(AIRT_COLL_STRING_TWO_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_COLL_STRING_TWO_PARAM) .setAction(ActionProvider.nameUARTCollStringTwoParam); } else if (name.equals(AIRTCT_TWO_PRIM_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRTCT_TWO_PRIM_PARAM) .setAction(ActionProvider.nameUARTCTTwoPrimParam); } else if (name.equals(AIRT_COLL_CT_TWO_PRIM_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_COLL_CT_TWO_PRIM_PARAM) .setAction(ActionProvider.nameUARTCollCTTwoPrimParam); } else if (name.equals(AIRTET_TWO_KEY_TWO_PRIM_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRTET_TWO_KEY_TWO_PRIM_PARAM) .setAction(ActionProvider.nameUARTETTwoKeyTwoPrimParam); } else if (name.equals(AIRT_COLL_ET_KEY_NAV_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_COLL_ET_KEY_NAV_PARAM) .setAction(ActionProvider.nameUARTCollETKeyNavParam); } else if (name.equals(AIRTES_ALL_PRIM_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRTES_ALL_PRIM_PARAM) .setEntitySet("ESAllPrim") .setAction(ActionProvider.nameUARTETAllPrimParam); } else if (name.equals(AIRT_COLL_ES_ALL_PRIM_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_COLL_ES_ALL_PRIM_PARAM) .setEntitySet("ESAllPrim") .setAction(ActionProvider.nameUARTCollETAllPrimParam); } else if (name.equals(AIRT)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT) .setAction(ActionProvider.nameUART); } else if (name.equals(AIRT_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_PARAM) .setAction(ActionProvider.nameUARTParam); } else if (name.equals(AIRT_TWO_PARAM)) { - return new ActionImport() + return new CsdlActionImport() .setName(AIRT_TWO_PARAM) .setAction(ActionProvider.nameUARTTwoParam); } @@ -505,179 +506,179 @@ public class ContainerProvider { return null; } - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String name) + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String name) throws ODataException { if (entityContainer.equals(nameContainer)) { if (name.equals("FINRTInt16")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFNRTInt16) .setIncludeInServiceDocument(true); } else if (name.equals("FINInvisibleRTInt16")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFNRTInt16); } else if (name.equals("FINInvisible2RTInt16")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFNRTInt16); } else if (name.equals("FICRTETKeyNav")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTETKeyNav); } else if (name.equals("FICRTESTwoKeyNav")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTETTwoKeyNav) .setEntitySet(entityContainer.getFullQualifiedNameAsString() + "/ESTwoKeyNav") .setIncludeInServiceDocument(true); } else if (name.equals("FICRTETTwoKeyNavParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTETTwoKeyNavParam) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTStringTwoParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTStringTwoParam) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollStringTwoParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollStringTwoParam) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCTAllPrimTwoParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCTAllPrimTwoParam) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTESMixPrimCollCompTwoParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam) .setIncludeInServiceDocument(true); - - } else if(name.equals("FINRTCollETMixPrimCollCompTwoParam")) { - return new FunctionImport() - .setName(name) - .setFunction(FunctionProvider.nameUFNRTCollETMixPrimCollCompTwoParam) - .setIncludeInServiceDocument(true); - + + } else if (name.equals("FINRTCollETMixPrimCollCompTwoParam")) { + return new CsdlFunctionImport() + .setName(name) + .setFunction(FunctionProvider.nameUFNRTCollETMixPrimCollCompTwoParam) + .setIncludeInServiceDocument(true); + } else if (name.equals("FICRTCollETMixPrimCollCompTwoParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollETMixPrimCollCompTwoParam) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollCTTwoPrim")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollCTTwoPrim) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTESMedia")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTETMedia) .setEntitySet(entityContainer.getFullQualifiedNameAsString() + "/ESMedia") .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollESMedia")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollETMedia) .setEntitySet(entityContainer.getFullQualifiedNameAsString() + "/ESMedia") .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCTTwoPrimParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCTTwoPrimParam) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCTTwoPrim")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCTTwoPrim) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollString")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollString) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTString")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTString) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollESTwoKeyNavParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam) .setEntitySet(entityContainer.getFullQualifiedNameAsString() + "/ESTwoKeyNav") .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollCTTwoPrimParam")) { - return new FunctionImport() + return new CsdlFunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollCTTwoPrimParam) .setIncludeInServiceDocument(true); - - } else if(name.equals("FINRTCollCTNavFiveProp")) { - return new FunctionImport() - .setName(name) - .setFunction(FunctionProvider.nameUFNRTCollCTNavFiveProp) - .setIncludeInServiceDocument(true); - - } else if(name.equals("FICRTCollESKeyNavContParam")) { - return new FunctionImport() - .setName(name) - .setFunction(FunctionProvider.nameUFCRTCollETKeyNavContParam) - .setEntitySet("ESKeyNavCont") - .setIncludeInServiceDocument(true); + + } else if (name.equals("FINRTCollCTNavFiveProp")) { + return new CsdlFunctionImport() + .setName(name) + .setFunction(FunctionProvider.nameUFNRTCollCTNavFiveProp) + .setIncludeInServiceDocument(true); + + } else if (name.equals("FICRTCollESKeyNavContParam")) { + return new CsdlFunctionImport() + .setName(name) + .setFunction(FunctionProvider.nameUFCRTCollETKeyNavContParam) + .setEntitySet("ESKeyNavCont") + .setIncludeInServiceDocument(true); } } - + return null; } - public Singleton getSingleton(final FullQualifiedName entityContainer, final String name) throws ODataException { + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String name) throws ODataException { if (entityContainer.equals(nameContainer)) { if (name.equals("SI")) { - return new Singleton() + return new CsdlSingleton() .setName("SI") .setType(EntityTypeProvider.nameETTwoPrim); } else if (name.equals("SINav")) { - return new Singleton() + return new CsdlSingleton() .setName("SINav") .setType(EntityTypeProvider.nameETTwoKeyNav) .setNavigationPropertyBindings(Arrays.asList( - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavMany") .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavOne") .setTarget("ESTwoKeyNav"), - new NavigationPropertyBinding() + new CsdlNavigationPropertyBinding() .setPath("NavPropertyETKeyNavOne") .setTarget("ESKeyNav") )); } else if (name.equals("SIMedia")) { - return new Singleton() + return new CsdlSingleton() .setName("SIMedia") .setType(EntityTypeProvider.nameETMedia); } diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java index 410a0bce0..afb23d661 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java @@ -24,25 +24,25 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ActionImport; -import org.apache.olingo.commons.api.edm.provider.AliasInfo; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import org.apache.olingo.server.api.edmx.EdmxReference; -public class EdmTechProvider extends AbstractEdmProvider { +public class EdmTechProvider extends CsdlAbstractEdmProvider { public static final String nameSpace = "olingo.odata.test1"; @@ -71,83 +71,84 @@ public class EdmTechProvider extends AbstractEdmProvider { } @Override - public List getAliasInfos() throws ODataException { + public List getAliasInfos() throws ODataException { return Arrays.asList( - new AliasInfo().setAlias("Namespace1_Alias").setNamespace(nameSpace) + new CsdlAliasInfo().setAlias("Namespace1_Alias").setNamespace(nameSpace) ); } @Override - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { return enumTypeProvider.getEnumType(enumTypeName); } @Override - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { return typeDefinitionProvider.getTypeDefinition(typeDefinitionName); } @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { return entityTypeProvider.getEntityType(entityTypeName); } @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { return complexTypeProvider.getComplexType(complexTypeName); } @Override - public List getActions(final FullQualifiedName actionName) throws ODataException { + public List getActions(final FullQualifiedName actionName) throws ODataException { return actionProvider.getActions(actionName); } @Override - public List getFunctions(final FullQualifiedName functionName) throws ODataException { + public List getFunctions(final FullQualifiedName functionName) throws ODataException { return functionProvider.getFunctions(functionName); } @Override - public Term getTerm(final FullQualifiedName termName) throws ODataException { + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException { return null; } @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { return containerProvider.getEntitySet(entityContainer, entitySetName); } @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) throws ODataException { return containerProvider.getSingleton(entityContainer, singletonName); } @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) throws ODataException { return containerProvider.getActionImport(entityContainer, actionImportName); } @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) throws ODataException { return containerProvider.getFunctionImport(entityContainer, functionImportName); } @Override - public List getSchemas() throws ODataException { + public List getSchemas() throws ODataException { return schemaProvider.getSchemas(); } @Override - public EntityContainer getEntityContainer() throws ODataException { + public CsdlEntityContainer getEntityContainer() throws ODataException { return containerProvider.getEntityContainer(); } @Override - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException { return containerProvider.getEntityContainerInfo(entityContainerName); } } diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java index 4eb1b41d5..50a80044b 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java @@ -20,11 +20,11 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint; import java.util.Arrays; @@ -81,12 +81,12 @@ public class EntityTypeProvider { public static final FullQualifiedName nameETMixEnumDefCollComp = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETMixEnumDefCollComp"); - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { if (entityTypeName.equals(nameETAllPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAllPrim") .setKey(Arrays.asList( - new PropertyRef().setName("PropertyInt16"))) + new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString, PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertySByte, @@ -99,9 +99,9 @@ public class EntityTypeProvider { PropertyProvider.collectionNavPropertyETTwoPrimMany_ETTwoPrim)); } else if (entityTypeName.equals(nameETCollAllPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETCollAllPrim") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties( Arrays.asList( @@ -120,9 +120,9 @@ public class EntityTypeProvider { )); } else if (entityTypeName.equals(nameETTwoPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETTwoPrim") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString)) .setNavigationProperties( @@ -130,66 +130,66 @@ public class EntityTypeProvider { PropertyProvider.collectionNavPropertyETAllPrimMany_ETAllPrim)); } else if (entityTypeName.equals(nameETMixPrimCollComp)) { - return new EntityType() + return new CsdlEntityType() .setName("ETMixPrimCollComp") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.collPropertyString, PropertyProvider.propertyComp_CTTwoPrim, PropertyProvider.collPropertyComp_CTTwoPrim)); } else if (entityTypeName.equals(nameETTwoKeyTwoPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETTwoKeyTwoPrim") .setKey(Arrays.asList( - new PropertyRef().setName("PropertyInt16"), - new PropertyRef().setName("PropertyString"))) + new CsdlPropertyRef().setName("PropertyInt16"), + new CsdlPropertyRef().setName("PropertyString"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable)); } else if (entityTypeName.equals(nameETBaseTwoKeyTwoPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETBaseTwoKeyTwoPrim") .setBaseType(nameETTwoKeyTwoPrim); } else if (entityTypeName.equals(nameETTwoBaseTwoKeyTwoPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETTwoBaseTwoKeyTwoPrim") .setBaseType(nameETTwoKeyTwoPrim); } else if (entityTypeName.equals(nameETBase)) { - return new EntityType() + return new CsdlEntityType() .setName("ETBase") .setBaseType(nameETTwoPrim) - .setProperties(Arrays.asList(new Property() + .setProperties(Arrays.asList(new CsdlProperty() .setName("AdditionalPropertyString_5") .setType(PropertyProvider.nameString))); } else if (entityTypeName.equals(nameETTwoBase)) { - return new EntityType() + return new CsdlEntityType() .setName("ETTwoBase") .setBaseType(nameETBase) - .setProperties(Arrays.asList(new Property() + .setProperties(Arrays.asList(new CsdlProperty() .setName("AdditionalPropertyString_6") .setType(PropertyProvider.nameString)) ); } else if (entityTypeName.equals(nameETAllKey)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAllKey") .setKey(Arrays.asList( - new PropertyRef().setName("PropertyString"), - new PropertyRef().setName("PropertyBoolean"), - new PropertyRef().setName("PropertyByte"), - new PropertyRef().setName("PropertySByte"), - new PropertyRef().setName("PropertyInt16"), - new PropertyRef().setName("PropertyInt32"), - new PropertyRef().setName("PropertyInt64"), - new PropertyRef().setName("PropertyDecimal"), - new PropertyRef().setName("PropertyDate"), - new PropertyRef().setName("PropertyDateTimeOffset"), - new PropertyRef().setName("PropertyDuration"), - new PropertyRef().setName("PropertyGuid"), - new PropertyRef().setName("PropertyTimeOfDay"))) + new CsdlPropertyRef().setName("PropertyString"), + new CsdlPropertyRef().setName("PropertyBoolean"), + new CsdlPropertyRef().setName("PropertyByte"), + new CsdlPropertyRef().setName("PropertySByte"), + new CsdlPropertyRef().setName("PropertyInt16"), + new CsdlPropertyRef().setName("PropertyInt32"), + new CsdlPropertyRef().setName("PropertyInt64"), + new CsdlPropertyRef().setName("PropertyDecimal"), + new CsdlPropertyRef().setName("PropertyDate"), + new CsdlPropertyRef().setName("PropertyDateTimeOffset"), + new CsdlPropertyRef().setName("PropertyDuration"), + new CsdlPropertyRef().setName("PropertyGuid"), + new CsdlPropertyRef().setName("PropertyTimeOfDay"))) .setProperties( Arrays.asList( PropertyProvider.propertyString_NotNullable, PropertyProvider.propertyBoolean_NotNullable, @@ -202,56 +202,56 @@ public class EntityTypeProvider { PropertyProvider.propertyTimeOfDay_NotNullable)); } else if (entityTypeName.equals(nameETCompAllPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETCompAllPrim") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties( Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComp_CTAllPrim)); } else if (entityTypeName.equals(nameETCompCollAllPrim)) { - return new EntityType() + return new CsdlEntityType() .setName("ETCompCollAllPrim") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties( Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComp_CTCollAllPrim)); } else if (entityTypeName.equals(nameETCompComp)) { - return new EntityType() + return new CsdlEntityType() .setName("ETCompComp") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties( Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComp_CTCompComp)); } else if (entityTypeName.equals(nameETCompCollComp)) { - return new EntityType() + return new CsdlEntityType() .setName("ETCompCollComp") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties( Arrays .asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComp_CTCompCollComp)); } else if (entityTypeName.equals(nameETMedia)) { - return new EntityType() + return new CsdlEntityType() .setName("ETMedia") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable)) .setHasStream(true); } else if (entityTypeName.equals(nameETKeyTwoKeyComp)) { - return new EntityType() + return new CsdlEntityType() .setName("ETKeyTwoKeyComp") .setKey(Arrays.asList( - new PropertyRef() + new CsdlPropertyRef() .setName("PropertyInt16"), - new PropertyRef() + new CsdlPropertyRef() .setName("PropertyComp/PropertyInt16") .setAlias("KeyAlias1"), - new PropertyRef() + new CsdlPropertyRef() .setName("PropertyComp/PropertyString") .setAlias("KeyAlias2"), - new PropertyRef() + new CsdlPropertyRef() .setName("PropertyCompComp/PropertyComp/PropertyString") .setAlias("KeyAlias3"))) .setProperties( @@ -260,19 +260,19 @@ public class EntityTypeProvider { PropertyProvider.propertyCompComp_CTCompComp)); } else if (entityTypeName.equals(nameETServerSidePaging)) { - return new EntityType() + return new CsdlEntityType() .setName(nameETServerSidePaging.getName()) - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable)); } else if (entityTypeName.equals(nameETAllNullable)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAllNullable") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyKey"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyKey"))) .setProperties( Arrays.asList( - new Property() + new CsdlProperty() .setName("PropertyKey").setType(PropertyProvider.nameInt16).setNullable(false), PropertyProvider.propertyInt16_ExplicitNullable, PropertyProvider.propertyString_ExplicitNullable, PropertyProvider.propertyBoolean_ExplicitNullable, PropertyProvider.propertyByte_ExplicitNullable, @@ -301,9 +301,9 @@ public class EntityTypeProvider { PropertyProvider.collPropertyTimeOfDay_ExplicitNullable)); } else if (entityTypeName.equals(nameETKeyNav)) { - return new EntityType() + return new CsdlEntityType() .setName("ETKeyNav") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties( Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable, @@ -311,7 +311,7 @@ public class EntityTypeProvider { PropertyProvider.propertyCompAllPrim_CTAllPrim, PropertyProvider.propertyCompTwoPrim_CTTwoPrim, PropertyProvider.collPropertyString, PropertyProvider.collPropertyInt16, PropertyProvider.collPropertyComp_CTPrimComp, - new Property() + new CsdlProperty() .setName("PropertyCompCompNav").setType(ComplexTypeProvider.nameCTCompNav) )) .setNavigationProperties( @@ -323,18 +323,18 @@ public class EntityTypeProvider { PropertyProvider.navPropertyETMediaOne_ETMedia, PropertyProvider.collectionNavPropertyETMediaMany_ETMedia)); } else if (entityTypeName.equals(nameETKeyPrimNav)) { - return new EntityType() + return new CsdlEntityType() .setName("ETKeyPrimNav") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_ExplicitNullable)) .setNavigationProperties( Arrays.asList( PropertyProvider.navPropertyETKeyPrimNavOne_ETKeyPrimNav)); } else if(entityTypeName.equals(nameETKeyNavCont)) { - return new EntityType() + return new CsdlEntityType() .setName("ETKeyNavCont") - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable, PropertyProvider.propertyCompNavCont)) @@ -344,28 +344,28 @@ public class EntityTypeProvider { )); } else if (entityTypeName.equals(nameETTwoKeyNav)) { - return new EntityType() + return new CsdlEntityType() .setName("ETTwoKeyNav") .setKey(Arrays.asList( - new PropertyRef().setName("PropertyInt16"), - new PropertyRef().setName("PropertyString"))) + new CsdlPropertyRef().setName("PropertyInt16"), + new CsdlPropertyRef().setName("PropertyString"))) .setProperties( Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable, PropertyProvider.propertyComp_CTPrimComp_NotNullable, - new Property().setName("PropertyCompNav").setType(ComplexTypeProvider.nameCTBasePrimCompNav) + new CsdlProperty().setName("PropertyCompNav").setType(ComplexTypeProvider.nameCTBasePrimCompNav) .setNullable(false), PropertyProvider.collPropertyComp_CTPrimComp, - new Property().setName("CollPropertyCompNav").setType(ComplexTypeProvider.nameCTNavFiveProp) + new CsdlProperty().setName("CollPropertyCompNav").setType(ComplexTypeProvider.nameCTNavFiveProp) .setCollection(true), PropertyProvider.collPropertyString, PropertyProvider.propertyCompTwoPrim_CTTwoPrim )) .setNavigationProperties(Arrays.asList( - new NavigationProperty() + new CsdlNavigationProperty() .setName("NavPropertyETKeyNavOne") .setType(nameETKeyNav) .setReferentialConstraints(Arrays.asList( - new ReferentialConstraint() + new CsdlReferentialConstraint() .setProperty("PropertyInt16") .setReferencedProperty("PropertyInt16"))), PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav, @@ -374,70 +374,70 @@ public class EntityTypeProvider { PropertyProvider.collectionNavPropertySINav)); } else if (entityTypeName.equals(nameETBaseTwoKeyNav)) { - return new EntityType() + return new CsdlEntityType() .setName("ETBaseTwoKeyNav") .setBaseType(nameETTwoKeyNav) .setProperties(Arrays.asList(PropertyProvider.propertyDate_ExplicitNullable)) .setNavigationProperties(Arrays.asList( - new NavigationProperty() + new CsdlNavigationProperty() .setName("NavPropertyETBaseTwoKeyNavOne") .setType(nameETBaseTwoKeyNav), - new NavigationProperty() + new CsdlNavigationProperty() .setName("NavPropertyETTwoBaseTwoKeyNavOne") .setType(nameETTwoBaseTwoKeyNav))); } else if (entityTypeName.equals(nameETTwoBaseTwoKeyNav)) { - return new EntityType() + return new CsdlEntityType() .setName("ETTwoBaseTwoKeyNav") .setBaseType(nameETBaseTwoKeyNav) - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList(PropertyProvider.propertyGuid_ExplicitNullable)) .setNavigationProperties(Arrays.asList( - new NavigationProperty() + new CsdlNavigationProperty() .setName("NavPropertyETBaseTwoKeyNavMany") .setType(nameETBaseTwoKeyNav) .setCollection(true) )); } else if (entityTypeName.equals(nameETFourKeyAlias)) { - return new EntityType() + return new CsdlEntityType() .setName("ETFourKeyAlias") .setKey( Arrays.asList( - new PropertyRef().setName("PropertyInt16"), - new PropertyRef().setName("PropertyComp/PropertyInt16").setAlias("KeyAlias1"), - new PropertyRef().setName("PropertyComp/PropertyString").setAlias("KeyAlias2"), - new PropertyRef().setName("PropertyCompComp/PropertyComp/PropertyString").setAlias("KeyAlias3"))) + new CsdlPropertyRef().setName("PropertyInt16"), + new CsdlPropertyRef().setName("PropertyComp/PropertyInt16").setAlias("KeyAlias1"), + new CsdlPropertyRef().setName("PropertyComp/PropertyString").setAlias("KeyAlias2"), + new CsdlPropertyRef().setName("PropertyCompComp/PropertyComp/PropertyString").setAlias("KeyAlias3"))) .setProperties( Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComp_CTTwoPrim_NotNullable, PropertyProvider.propertyCompComp_CTCompComp_NotNullable)); } else if (entityTypeName.equals(nameETCompMixPrimCollComp)) { - return new EntityType() + return new CsdlEntityType() .setName("ETCompMixPrimCollComp") .setKey(Arrays.asList( - new PropertyRef() + new CsdlPropertyRef() .setName("PropertyInt16"))) .setProperties( Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyMixedPrimCollComp_CTMixPrimCollComp)); } else if (entityTypeName.equals(nameETAbstract)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAbstract") .setAbstract(true) .setProperties(Arrays.asList(PropertyProvider.propertyString)); } else if (entityTypeName.equals(nameETAbstractBase)) { - return new EntityType() + return new CsdlEntityType() .setName("ETAbstractBase") .setBaseType(nameETAbstract) - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable)); } else if (entityTypeName.equals(nameETMixEnumDefCollComp)) { - return new EntityType() + return new CsdlEntityType() .setName(nameETMixEnumDefCollComp.getName()) - .setKey(Arrays.asList(new PropertyRef().setName("PropertyInt16"))) + .setKey(Arrays.asList(new CsdlPropertyRef().setName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyEnumString_ENString, diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java index 6b68a3396..b9eb069a3 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java @@ -21,8 +21,8 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EnumMember; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import java.util.Arrays; @@ -30,16 +30,16 @@ public class EnumTypeProvider { public static final FullQualifiedName nameENString = new FullQualifiedName(SchemaProvider.NAMESPACE, "ENString"); - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { if (enumTypeName.equals(nameENString)) { - return new EnumType() + return new CsdlEnumType() .setName("ENString") .setFlags(true) .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()) .setMembers(Arrays.asList( - new EnumMember().setName("String1").setValue("1"), - new EnumMember().setName("String2").setValue("2"), - new EnumMember().setName("String3").setValue("4"))); + new CsdlEnumMember().setName("String1").setValue("1"), + new CsdlEnumMember().setName("String2").setValue("2"), + new CsdlEnumMember().setName("String3").setValue("4"))); } return null; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java index f641c2a37..960c7f7a9 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java @@ -20,9 +20,9 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.Parameter; -import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlParameter; +import org.apache.olingo.commons.api.edm.provider.CsdlReturnType; import java.util.ArrayList; import java.util.Arrays; @@ -118,10 +118,10 @@ public class FunctionProvider { public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName( SchemaProvider.NAMESPACE, "BFCESTwoKeyNavRTCollCTNavFiveProp"); - + public static final FullQualifiedName nameBFCESKeyNavRTESTwoKeyNav = new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESKeyNavRTESTwoKeyNav"); - + // Unbound Functions public static final FullQualifiedName nameUFCRTCollCTTwoPrim = new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollCTTwoPrim"); @@ -166,339 +166,367 @@ public class FunctionProvider { public static final FullQualifiedName nameUFCRTCollETMixPrimCollCompTwoParam = new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETMixPrimCollCompTwoParam"); - + public static final FullQualifiedName nameUFCRTCollETKeyNavContParam = new FullQualifiedName(SchemaProvider.NAMESPACE, "UFCRTCollETKeyNavContParam"); - + public static final FullQualifiedName nameUFNRTInt16 = new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTInt16"); public static final FullQualifiedName nameUFNRTCollCTNavFiveProp = new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTCollCTNavFiveProp"); - public static final FullQualifiedName nameUFNRTCollETMixPrimCollCompTwoParam - = new FullQualifiedName(SchemaProvider.NAMESPACE, "UFNRTCollETMixPrimCollCompTwoParam"); + public static final FullQualifiedName nameUFNRTCollETMixPrimCollCompTwoParam = new FullQualifiedName( + SchemaProvider.NAMESPACE, "UFNRTCollETMixPrimCollCompTwoParam"); - public List getFunctions(final FullQualifiedName functionName) throws ODataException { + public List getFunctions(final FullQualifiedName functionName) throws ODataException { if (functionName.equals(nameUFNRTInt16)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName(functionName.getName()) - .setParameters(Collections. emptyList()) - .setReturnType(new ReturnType().setType(PropertyProvider.nameInt16))); + .setParameters(Collections. emptyList()) + .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameInt16))); } else if (functionName.equals(nameUFCRTETKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTETKeyNav") - .setParameters(new ArrayList()) + .setParameters(new ArrayList()) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) ); } else if (functionName.equals(nameUFCRTETTwoKeyNav)) { return Collections.singletonList( - new Function() + new CsdlFunction() .setName(functionName.getName()) - .setParameters(Collections. emptyList()) + .setParameters(Collections. emptyList()) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false))); + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false))); } else if (functionName.equals(nameUFCRTETTwoKeyNavParam)) { - return Arrays.asList( - new Function() + return Arrays + .asList( + new CsdlFunction() .setName("UFCRTETTwoKeyNavParam") .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) ) ); } else if (functionName.equals(nameUFCRTETTwoKeyNavParamCTTwoPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTETTwoKeyNavParamCTTwoPrim") .setParameters(Arrays.asList( - new Parameter().setName("ParameterCTTwoPrim").setType(ComplexTypeProvider.nameCTTwoPrim) + new CsdlParameter().setName("ParameterCTTwoPrim").setType(ComplexTypeProvider.nameCTTwoPrim) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) ) ); } else if (functionName.equals(nameUFCRTStringTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTStringTwoParam") .setParameters(Arrays.asList( - new Parameter() + new CsdlParameter() .setName("ParameterInt16") .setType(PropertyProvider.nameInt16) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setNullable(false)), - new Function() + new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false)), + new CsdlFunction() .setName("UFCRTStringTwoParam") .setParameters(Arrays.asList( - new Parameter() + new CsdlParameter() .setName("ParameterString") .setType(PropertyProvider.nameString) .setNullable(false), - new Parameter() + new CsdlParameter() .setName("ParameterInt16") .setType(PropertyProvider.nameInt16) .setNullable(false))) .setComposable(true) - .setReturnType(new ReturnType().setType(PropertyProvider.nameString).setNullable(false)) + .setReturnType(new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false)) ); } else if (functionName.equals(nameUFCRTCollETTwoKeyNavParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName(functionName.getName()) .setParameters(Collections.singletonList( - new Parameter() + new CsdlParameter() .setName("ParameterInt16") .setType(PropertyProvider.nameInt16) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); - - } else if(functionName.equals(nameUFCRTCollETKeyNavContParam)) { + + } else if (functionName.equals(nameUFCRTCollETKeyNavContParam)) { return Arrays.asList( - new Function() - .setName("UFCRTCollETKeyNavContParam") - .setBound(true) - .setComposable(true) - .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16") - .setNullable(false) - .setType(PropertyProvider.nameInt16))) - .setReturnType(new ReturnType().setType(EntityTypeProvider.nameETKeyNavCont) - .setCollection(true) - .setNullable(false)) + new CsdlFunction() + .setName("UFCRTCollETKeyNavContParam") + .setBound(true) + .setComposable(true) + .setParameters(Arrays.asList( + new CsdlParameter().setName("ParameterInt16") + .setNullable(false) + .setType(PropertyProvider.nameInt16))) + .setReturnType(new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNavCont) + .setCollection(true) + .setNullable(false)) ); } else if (functionName.equals(nameUFCRTString)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTString") .setComposable(true) - .setParameters(new ArrayList()) + .setParameters(new ArrayList()) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setNullable(false) + new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false) ) ); } else if (functionName.equals(nameUFCRTCollStringTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCollStringTwoParam") - .setParameters(Arrays.asList( - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false), - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false), + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false)) ); } else if (functionName.equals(nameUFCRTCollString)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCollString") - .setParameters(new ArrayList()) + .setParameters(new ArrayList()) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false)) ); } else if (functionName.equals(nameUFCRTCTAllPrimTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCTAllPrimTwoParam") - .setParameters(Arrays.asList( - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false), - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false), + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false)) ); - } else if(functionName.equals(nameUFNRTCollETMixPrimCollCompTwoParam)) { + } else if (functionName.equals(nameUFNRTCollETMixPrimCollCompTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFNRTCollETMixPrimCollCompTwoParam") - .setParameters(Arrays.asList( - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false), - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false), + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false))) .setComposable(false) .setBound(false) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTMixPrimCollComp) - .setNullable(false) - .setCollection(true)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTMixPrimCollComp) + .setNullable(false) + .setCollection(true)) ); } else if (functionName.equals(nameUFCRTCTTwoPrimParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCTTwoPrimParam") - .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false), - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false), + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) ); } else if (functionName.equals(nameUFCRTCollCTTwoPrimParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCollCTTwoPrimParam") - .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false), - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(true))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false), + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + true))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true) + .setNullable(false)) ); } else if (functionName.equals(nameUFCRTCTTwoPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCTTwoPrim") - .setParameters(new ArrayList()) + .setParameters(new ArrayList()) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) ); } else if (functionName.equals(nameUFCRTCollCTTwoPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTCollCTTwoPrim") .setComposable(true) - .setParameters(new ArrayList()) + .setParameters(new ArrayList()) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true) + .setNullable(false)) ); } else if (functionName.equals(nameUFCRTETMedia)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTETMedia") .setParameters(Arrays.asList( - new Parameter().setName("ParameterInt16").setNullable(false).setType(PropertyProvider.nameInt16) + new CsdlParameter().setName("ParameterInt16").setNullable(false).setType(PropertyProvider.nameInt16) )) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false)) ); } else if (functionName.equals(nameUFCRTCollETMedia)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName(functionName.getName()) - .setParameters(Collections. emptyList()) + .setParameters(Collections. emptyList()) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETMedia).setCollection(true).setNullable(false))); + new CsdlReturnType().setType(EntityTypeProvider.nameETMedia).setCollection(true).setNullable(false))); } else if (functionName.equals(nameUFCRTCollETMixPrimCollCompTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName(functionName.getName()) - .setParameters(Arrays.asList( - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false), - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false), + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false))) .setComposable(false) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true) + new CsdlReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true) .setNullable(false)) ); } else if (functionName.equals(nameUFCRTETAllPrimTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFCRTETAllPrimTwoParam") - .setParameters(Arrays.asList( - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false), - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false), + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETAllPrim).setNullable(false)) ); } else if (functionName.equals(nameUFCRTESMixPrimCollCompTwoParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName(functionName.getName()) - .setParameters(Arrays.asList( - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false), - new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false) - )) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable( + false), + new CsdlParameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable( + false) + )) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true) + new CsdlReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true) .setNullable(false)) ); } else if (functionName.equals(nameUFNRTCollCTNavFiveProp)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("UFNRTCollCTNavFiveProp") .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTESTwoKeyNav)) { return Arrays .asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTESTwoKeyNav") .setEntitySetPath("BindingParam/NavPropertyETTwoKeyNavMany") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true) .setNullable(false)), - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false), - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString) + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString) .setCollection(false).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true) .setNullable(false)), - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true) .setNullable(false)) -// new Function() + // new Function() // .setName("BFCESTwoKeyNavRTESTwoKeyNav") // .setBound(true) // .setParameters( @@ -514,418 +542,440 @@ public class FunctionProvider { } else if (functionName.equals(nameBFCStringRTESTwoKeyNav)) { return Arrays.asList( - new Function().setName("BFCStringRTESTwoKeyNav") + new CsdlFunction().setName("BFCStringRTESTwoKeyNav") .setBound(true) .setParameters(Arrays.asList( - new Parameter().setName("BindingParam").setType(PropertyProvider.nameString).setNullable(false))) + new CsdlParameter().setName("BindingParam").setType(PropertyProvider.nameString).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTETTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETBaseTwoKeyNavRTETTwoKeyNav") .setBound(true) .setParameters(Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) ) ); } else if (functionName.equals(nameBFCESBaseTwoKeyNavRTESBaseTwoKey)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESBaseTwoKeyNavRTESBaseTwoKey") .setBound(true) .setParameters(Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true) + new CsdlReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true) .setNullable(false)) ); } else if (functionName.equals(nameBFCESAllPrimRTCTAllPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESAllPrimRTCTAllPrim") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETAllPrim) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETAllPrim) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTCTTwoPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTCTTwoPrim") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTCollCTTwoPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTCollCTTwoPrim") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true) + .setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTString)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTString") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setNullable(false)) + new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTCollString)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTCollString") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false)) ); } else if (functionName.equals(nameBFCETTwoKeyNavRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETTwoKeyNavRTESTwoKeyNav") .setEntitySetPath("BindingParam/NavPropertyETTwoKeyNavOne") .setBound(true) .setParameters(Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETBaseTwoKeyNavRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } else if (functionName.equals(nameBFCSINavRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCSINavRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable( - false))) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + .setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTESBaseTwoKey)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETBaseTwoKeyNavRTESBaseTwoKey") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable( + new CsdlReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable( false)) ); } else if (functionName.equals(nameBFCCollStringRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCCollStringRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(PropertyProvider.nameString).setCollection(true) + new CsdlParameter().setName("BindingParam").setType(PropertyProvider.nameString).setCollection( + true) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } else if (functionName.equals(nameBFCCTPrimCompRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCCTPrimCompRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable( - false))) + new CsdlParameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp) + .setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } else if (functionName.equals(nameBFCCTPrimCompRTESBaseTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCCTPrimCompRTESBaseTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable( - false))) + new CsdlParameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp) + .setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable( + new CsdlReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable( false)) ); } else if (functionName.equals(nameBFCCollCTPrimCompRTESAllPrim)) { - return Arrays.asList( - new Function() + return Arrays + .asList( + new CsdlFunction() .setName("BFCCollCTPrimCompRTESAllPrim") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp) + new CsdlParameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true).setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)) ); } else if (functionName.equals(nameBFCESKeyNavRTETKeyNav)) { return Arrays .asList( - new Function() + new CsdlFunction() .setName("BFCESKeyNavRTETKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setCollection( - true).setNullable(false))) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav) + .setCollection( + true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) ); } else if (functionName.equals(nameBFCETKeyNavRTETKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETKeyNavRTETKeyNav") .setBound(true) - .setParameters(Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setNullable(false))) + .setParameters( + Arrays.asList( + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setNullable( + false))) .setComposable(true) .setEntitySetPath("BindingParam/NavPropertyETKeyNavOne") .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) ); } else if (functionName.equals(nameBFESTwoKeyNavRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFESTwoKeyNavRTESTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); - } else if(functionName.equals(nameBFCESKeyNavRTESTwoKeyNav)) { + } else if (functionName.equals(nameBFCESKeyNavRTESTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESKeyNavRTESTwoKeyNav") .setEntitySetPath("BindingParam/NavPropertyETTwoKeyNavMany") .setBound(true) .setComposable(true) .setParameters(Arrays.asList( - new Parameter().setName("BindingParam") - .setNullable(false) - .setType(EntityTypeProvider.nameETKeyNav) - .setCollection(true), - new Parameter().setName("ParameterString") - .setNullable(false) - .setType(PropertyProvider.nameString))) - .setReturnType(new ReturnType() - .setNullable(false) - .setType(EntityTypeProvider.nameETTwoKeyNav) - .setCollection(true)) + new CsdlParameter().setName("BindingParam") + .setNullable(false) + .setType(EntityTypeProvider.nameETKeyNav) + .setCollection(true), + new CsdlParameter().setName("ParameterString") + .setNullable(false) + .setType(PropertyProvider.nameString))) + .setReturnType(new CsdlReturnType() + .setNullable(false) + .setType(EntityTypeProvider.nameETTwoKeyNav) + .setCollection(true)) ); - + } else if (functionName.equals(nameBFCETTwoKeyNavRTETTwoKeyNav)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETTwoKeyNavRTETTwoKeyNav") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable( - false))) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + .setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)) ); } else if (functionName.equals(nameBFCETTwoKeyNavRTCTTwoPrim)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCETTwoKeyNavRTCTTwoPrim") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable( - false))) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + .setNullable( + false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTCTNavFiveProp)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTCTNavFiveProp") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setNullable(false)) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTCollCTNavFiveProp)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTCollCTNavFiveProp") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true) + new CsdlReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true) .setNullable(false)) ); } else if (functionName.equals(nameBFCESTwoKeyNavRTStringParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESTwoKeyNavRTStringParam") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true).setNullable(false), - new Parameter().setName("ParameterComp").setType(ComplexTypeProvider.nameCTTwoPrim) + new CsdlParameter().setName("ParameterComp").setType(ComplexTypeProvider.nameCTTwoPrim) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(PropertyProvider.nameString).setNullable(false)) + new CsdlReturnType().setType(PropertyProvider.nameString).setNullable(false)) ); } else if (functionName.equals(nameBFCESKeyNavRTETKeyNavParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCESKeyNavRTETKeyNavParam") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setCollection( - true).setNullable(false), - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString) + new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav) + .setCollection( + true).setNullable(false), + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false)) ); } else if (functionName.equals(nameBFCCTPrimCompRTETTwoKeyNavParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCCTPrimCompRTETTwoKeyNavParam") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable( - false), - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString) + new CsdlParameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp) + .setNullable( + false), + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString) .setNullable(false))) .setComposable(true) - .setReturnType(new ReturnType() + .setReturnType(new CsdlReturnType() .setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false) ) ); } else if (functionName.equals(nameBFCCTPrimCompRTESTwoKeyNavParam)) { return Arrays.asList( - new Function() + new CsdlFunction() .setName("BFCCTPrimCompRTESTwoKeyNavParam") .setBound(true) .setParameters( Arrays.asList( - new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable( - false), - new Parameter().setName("ParameterString").setType(PropertyProvider.nameString) + new CsdlParameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp) + .setNullable( + false), + new CsdlParameter().setName("ParameterString").setType(PropertyProvider.nameString) .setNullable(false))) .setComposable(true) .setReturnType( - new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false)) + new CsdlReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable( + false)) ); } diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java index db1976612..c18ed9dd1 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java @@ -20,8 +20,8 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; public class PropertyProvider { @@ -50,731 +50,737 @@ public class PropertyProvider { public static final FullQualifiedName nameTimeOfDay = EdmPrimitiveTypeKind.TimeOfDay.getFullQualifiedName(); // Primitive Properties -------------------------------------------------------------------------------------------- - public static final Property collPropertyBinary = new Property() + public static final CsdlProperty collPropertyBinary = new CsdlProperty() .setName("CollPropertyBinary") .setType(nameBinary) .setCollection(true); - public static final Property collPropertyBinary_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyBinary_ExplicitNullable = new CsdlProperty() .setName("CollPropertyBinary") .setType(nameBinary) .setNullable(true) .setCollection(true); - public static final Property collPropertyBinary_NotNullable = new Property() + public static final CsdlProperty collPropertyBinary_NotNullable = new CsdlProperty() .setName("CollPropertyBinary") .setType(nameBinary) .setNullable(false) .setCollection(true); - public static final Property collPropertyBoolean = new Property() + public static final CsdlProperty collPropertyBoolean = new CsdlProperty() .setName("CollPropertyBoolean") .setType(nameBoolean) .setCollection(true); - public static final Property collPropertyBoolean_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyBoolean_ExplicitNullable = new CsdlProperty() .setName("CollPropertyBoolean") .setType(nameBoolean) .setNullable(true) .setCollection(true); - public static final Property collPropertyBoolean_NotNullable = new Property() + public static final CsdlProperty collPropertyBoolean_NotNullable = new CsdlProperty() .setName("CollPropertyBoolean") .setType(nameBoolean) .setNullable(true) .setCollection(true); - public static final Property collPropertyByte = new Property() + public static final CsdlProperty collPropertyByte = new CsdlProperty() .setName("CollPropertyByte") .setType(nameByte) .setCollection(true); - public static final Property collPropertyByte_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyByte_ExplicitNullable = new CsdlProperty() .setName("CollPropertyByte") .setType(nameByte) .setNullable(true) .setCollection(true); - public static final Property collPropertyByte_NotNullable = new Property() + public static final CsdlProperty collPropertyByte_NotNullable = new CsdlProperty() .setName("CollPropertyByte") .setType(nameByte) .setNullable(false) .setCollection(true); - public static final Property collPropertyDate = new Property() + public static final CsdlProperty collPropertyDate = new CsdlProperty() .setName("CollPropertyDate") .setType(nameDate) .setCollection(true); - public static final Property collPropertyDate_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyDate_ExplicitNullable = new CsdlProperty() .setName("CollPropertyDate") .setType(nameDate) .setNullable(true) .setCollection(true); - public static final Property collPropertyDate_NotNullable = new Property() + public static final CsdlProperty collPropertyDate_NotNullable = new CsdlProperty() .setName("CollPropertyDate") .setType(nameDate) .setNullable(false) .setCollection(true); - public static final Property collPropertyDateTimeOffset = new Property() + public static final CsdlProperty collPropertyDateTimeOffset = new CsdlProperty() .setName("CollPropertyDateTimeOffset") .setType(nameDateTimeOffset) .setCollection(true); - public static final Property collPropertyDateTimeOffset_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyDateTimeOffset_ExplicitNullable = new CsdlProperty() .setName("CollPropertyDateTimeOffset") .setType(nameDateTimeOffset) .setNullable(true) .setCollection(true); - public static final Property collPropertyDateTimeOffset_NotNullable = new Property() + public static final CsdlProperty collPropertyDateTimeOffset_NotNullable = new CsdlProperty() .setName("CollPropertyDateTimeOffset") .setType(nameDateTimeOffset) .setNullable(false) .setCollection(true); - public static final Property collPropertyDecimal = new Property() + public static final CsdlProperty collPropertyDecimal = new CsdlProperty() .setName("CollPropertyDecimal") .setType(nameDecimal) .setCollection(true); - public static final Property collPropertyDecimal_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyDecimal_ExplicitNullable = new CsdlProperty() .setName("CollPropertyDecimal") .setType(nameDecimal) .setNullable(true) .setCollection(true); - public static final Property collPropertyDecimal_NotNullable = new Property() + public static final CsdlProperty collPropertyDecimal_NotNullable = new CsdlProperty() .setName("CollPropertyDecimal") .setType(nameDecimal) .setNullable(false) .setCollection(true); - public static final Property collPropertyDouble = new Property() + public static final CsdlProperty collPropertyDouble = new CsdlProperty() .setName("CollPropertyDouble") .setType(nameDouble) .setCollection(true); - public static final Property collPropertyDouble_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyDouble_ExplicitNullable = new CsdlProperty() .setName("CollPropertyDouble") .setType(nameDouble) .setNullable(true) .setCollection(true); - public static final Property collPropertyDouble_NotNullable = new Property() + public static final CsdlProperty collPropertyDouble_NotNullable = new CsdlProperty() .setName("CollPropertyDouble") .setType(nameDouble) .setNullable(false) .setCollection(true); - public static final Property collPropertyDuration = new Property() + public static final CsdlProperty collPropertyDuration = new CsdlProperty() .setName("CollPropertyDuration") .setType(nameDuration) .setCollection(true); - public static final Property collPropertyDuration_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyDuration_ExplicitNullable = new CsdlProperty() .setName("CollPropertyDuration") .setType(nameDuration) .setNullable(true) .setCollection(true); - public static final Property collPropertyDuration_NotNullable = new Property() + public static final CsdlProperty collPropertyDuration_NotNullable = new CsdlProperty() .setName("CollPropertyDuration") .setType(nameDuration) .setNullable(false) .setCollection(true); - public static final Property collPropertyGuid = new Property() + public static final CsdlProperty collPropertyGuid = new CsdlProperty() .setName("CollPropertyGuid") .setType(nameGuid) .setCollection(true); - public static final Property collPropertyGuid_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyGuid_ExplicitNullable = new CsdlProperty() .setName("CollPropertyGuid") .setType(nameGuid) .setNullable(true) .setCollection(true); - public static final Property collPropertyGuid_NotNullable = new Property() + public static final CsdlProperty collPropertyGuid_NotNullable = new CsdlProperty() .setName("CollPropertyGuid") .setType(nameGuid) .setNullable(false) .setCollection(true); - public static final Property collPropertyInt16 = new Property() + public static final CsdlProperty collPropertyInt16 = new CsdlProperty() .setName("CollPropertyInt16") .setType(nameInt16) .setCollection(true); - public static final Property collPropertyInt16_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyInt16_ExplicitNullable = new CsdlProperty() .setName("CollPropertyInt16") .setType(nameInt16) .setNullable(true) .setCollection(true); - public static final Property collPropertyInt16_NotNullable = new Property() + public static final CsdlProperty collPropertyInt16_NotNullable = new CsdlProperty() .setName("CollPropertyInt16") .setType(nameInt16) .setNullable(false) .setCollection(true); - public static final Property collPropertyInt32 = new Property() + public static final CsdlProperty collPropertyInt32 = new CsdlProperty() .setName("CollPropertyInt32") .setType(nameInt32) .setCollection(true); - public static final Property collPropertyInt32_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyInt32_ExplicitNullable = new CsdlProperty() .setName("CollPropertyInt32") .setType(nameInt32) .setNullable(true) .setCollection(true); - public static final Property collPropertyInt32_NotNullable = new Property() + public static final CsdlProperty collPropertyInt32_NotNullable = new CsdlProperty() .setName("CollPropertyInt32") .setType(nameInt32) .setNullable(false) .setCollection(true); - public static final Property collPropertyInt64 = new Property() + public static final CsdlProperty collPropertyInt64 = new CsdlProperty() .setName("CollPropertyInt64") .setType(nameInt64) .setCollection(true); - public static final Property collPropertyInt64_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyInt64_ExplicitNullable = new CsdlProperty() .setName("CollPropertyInt64") .setType(nameInt64) .setNullable(true) .setCollection(true); - public static final Property collPropertyInt64_NotNullable = new Property() + public static final CsdlProperty collPropertyInt64_NotNullable = new CsdlProperty() .setName("CollPropertyInt64") .setType(nameInt64) .setNullable(false) .setCollection(true); - public static final Property collPropertySByte = new Property() + public static final CsdlProperty collPropertySByte = new CsdlProperty() .setName("CollPropertySByte") .setType(nameSByte) .setCollection(true); - public static final Property collPropertySByte_ExplicitNullable = new Property() + public static final CsdlProperty collPropertySByte_ExplicitNullable = new CsdlProperty() .setName("CollPropertySByte") .setType(nameSByte) .setNullable(true) .setCollection(true); - public static final Property collPropertySByte_NotNullable = new Property() + public static final CsdlProperty collPropertySByte_NotNullable = new CsdlProperty() .setName("CollPropertySByte") .setType(nameSByte) .setNullable(false) .setCollection(true); - public static final Property collPropertySingle = new Property() + public static final CsdlProperty collPropertySingle = new CsdlProperty() .setName("CollPropertySingle") .setType(nameSingle) .setCollection(true); - public static final Property collPropertySingle_ExplicitNullable = new Property() + public static final CsdlProperty collPropertySingle_ExplicitNullable = new CsdlProperty() .setName("CollPropertySingle") .setType(nameSingle) .setNullable(true) .setCollection(true); - public static final Property collPropertySingle_NotNullable = new Property() + public static final CsdlProperty collPropertySingle_NotNullable = new CsdlProperty() .setName("CollPropertySingle") .setType(nameSingle) .setNullable(false) .setCollection(true); - public static final Property collPropertyString = new Property() + public static final CsdlProperty collPropertyString = new CsdlProperty() .setName("CollPropertyString") .setType(nameString) .setCollection(true); - public static final Property collPropertyString_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyString_ExplicitNullable = new CsdlProperty() .setName("CollPropertyString") .setType(nameString) .setNullable(true) .setCollection(true); - public static final Property collPropertyString_NotNullable = new Property() + public static final CsdlProperty collPropertyString_NotNullable = new CsdlProperty() .setName("CollPropertyString") .setType(nameString) .setNullable(false) .setCollection(true); - public static final Property collPropertyTimeOfDay = new Property() + public static final CsdlProperty collPropertyTimeOfDay = new CsdlProperty() .setName("CollPropertyTimeOfDay") .setType(nameTimeOfDay) .setCollection(true); - public static final Property collPropertyTimeOfDay_ExplicitNullable = new Property() + public static final CsdlProperty collPropertyTimeOfDay_ExplicitNullable = new CsdlProperty() .setName("CollPropertyTimeOfDay") .setType(nameTimeOfDay) .setNullable(true) .setCollection(true); - public static final Property collPropertyTimeOfDay_NotNullable = new Property() + public static final CsdlProperty collPropertyTimeOfDay_NotNullable = new CsdlProperty() .setName("CollPropertyTimeOfDay") .setType(nameTimeOfDay) .setNullable(false) .setCollection(true); - public static final Property propertyBinary = new Property() + public static final CsdlProperty propertyBinary = new CsdlProperty() .setName("PropertyBinary") .setType(nameBinary); - public static final Property propertyBinary_NotNullable = new Property() + public static final CsdlProperty propertyBinary_NotNullable = new CsdlProperty() .setName("PropertyBinary") .setType(nameBinary) .setNullable(false); - public static final Property propertyBinary_ExplicitNullable = new Property() + public static final CsdlProperty propertyBinary_ExplicitNullable = new CsdlProperty() .setName("PropertyBinary") .setType(nameBinary) .setNullable(true); - public static final Property propertyBoolean = new Property() + public static final CsdlProperty propertyBoolean = new CsdlProperty() .setName("PropertyBoolean") .setType(nameBoolean); - public static final Property propertyBoolean_NotNullable = new Property() + public static final CsdlProperty propertyBoolean_NotNullable = new CsdlProperty() .setName("PropertyBoolean") .setType(nameBoolean) .setNullable(false); - public static final Property propertyBoolean_ExplicitNullable = new Property() + public static final CsdlProperty propertyBoolean_ExplicitNullable = new CsdlProperty() .setName("PropertyBoolean") .setType(nameBoolean) .setNullable(true); - public static final Property propertyByte = new Property() + public static final CsdlProperty propertyByte = new CsdlProperty() .setName("PropertyByte") .setType(nameByte); - public static final Property propertyByte_NotNullable = new Property() + public static final CsdlProperty propertyByte_NotNullable = new CsdlProperty() .setName("PropertyByte") .setType(nameByte) .setNullable(false); - public static final Property propertyByte_ExplicitNullable = new Property() + public static final CsdlProperty propertyByte_ExplicitNullable = new CsdlProperty() .setName("PropertyByte") .setType(nameByte) .setNullable(true); - public static final Property propertyDate = new Property() + public static final CsdlProperty propertyDate = new CsdlProperty() .setName("PropertyDate") .setType(nameDate); - public static final Property propertyDate_NotNullable = new Property() + public static final CsdlProperty propertyDate_NotNullable = new CsdlProperty() .setName("PropertyDate") .setType(nameDate) .setNullable(false); - public static final Property propertyDate_ExplicitNullable = new Property() + public static final CsdlProperty propertyDate_ExplicitNullable = new CsdlProperty() .setName("PropertyDate") .setType(nameDate) .setNullable(true); - public static final Property propertyDateTimeOffset = new Property() + public static final CsdlProperty propertyDateTimeOffset = new CsdlProperty() .setName("PropertyDateTimeOffset") .setType(nameDateTimeOffset); - public static final Property propertyDateTimeOffset_Precision = new Property() + public static final CsdlProperty propertyDateTimeOffset_Precision = new CsdlProperty() .setName("PropertyDateTimeOffset") .setPrecision(12) .setType(nameDateTimeOffset); - public static final Property propertyDateTimeOffset_NotNullable = new Property() + public static final CsdlProperty propertyDateTimeOffset_NotNullable = new CsdlProperty() .setName("PropertyDateTimeOffset") .setType(nameDateTimeOffset) .setNullable(false); - public static final Property propertyDateTimeOffset_ExplicitNullable = new Property() + public static final CsdlProperty propertyDateTimeOffset_ExplicitNullable = new CsdlProperty() .setName("PropertyDateTimeOffset") .setType(nameDateTimeOffset) .setNullable(true); - public static final Property propertyDecimal_Scale_Precision = new Property() + public static final CsdlProperty propertyDecimal_Scale_Precision = new CsdlProperty() .setName("PropertyDecimal") .setScale(5) .setPrecision(11) .setType(nameDecimal); - public static final Property propertyDecimal_Scale = new Property() + public static final CsdlProperty propertyDecimal_Scale = new CsdlProperty() .setName("PropertyDecimal") .setScale(10) .setType(nameDecimal); - public static final Property propertyDecimal_NotNullable = new Property() + public static final CsdlProperty propertyDecimal_NotNullable = new CsdlProperty() .setName("PropertyDecimal") .setType(nameDecimal) .setNullable(false); - public static final Property propertyDecimal_ExplicitNullable = new Property() + public static final CsdlProperty propertyDecimal_ExplicitNullable = new CsdlProperty() .setName("PropertyDecimal") .setType(nameDecimal) .setNullable(true); - public static final Property propertyDouble = new Property() + public static final CsdlProperty propertyDouble = new CsdlProperty() .setName("PropertyDouble") .setType(nameDouble); - public static final Property propertyDouble_NotNullable = new Property() + public static final CsdlProperty propertyDouble_NotNullable = new CsdlProperty() .setName("PropertyDouble") .setType(nameDouble) .setNullable(false); - public static final Property propertyDouble_ExplicitNullable = new Property() + public static final CsdlProperty propertyDouble_ExplicitNullable = new CsdlProperty() .setName("PropertyDouble") .setType(nameDouble) .setNullable(true); - public static final Property propertyDuration = new Property() + public static final CsdlProperty propertyDuration = new CsdlProperty() .setName("PropertyDuration") .setType(nameDuration); - public static final Property propertyDuration_NotNullable = new Property() + public static final CsdlProperty propertyDuration_NotNullable = new CsdlProperty() .setName("PropertyDuration") .setType(nameDuration) .setNullable(false); - public static final Property propertyDuration_ExplicitNullable = new Property() + public static final CsdlProperty propertyDuration_ExplicitNullable = new CsdlProperty() .setName("PropertyDuration") .setType(nameDuration) .setNullable(true); - public static final Property propertyGuid = new Property() + public static final CsdlProperty propertyGuid = new CsdlProperty() .setName("PropertyGuid") .setType(nameGuid); - public static final Property propertyGuid_NotNullable = new Property() + public static final CsdlProperty propertyGuid_NotNullable = new CsdlProperty() .setName("PropertyGuid") .setType(nameGuid) .setNullable(false); - public static final Property propertyGuid_ExplicitNullable = new Property() + public static final CsdlProperty propertyGuid_ExplicitNullable = new CsdlProperty() .setName("PropertyGuid") .setType(nameGuid) .setNullable(true); - public static final Property propertyInt16 = new Property() + public static final CsdlProperty propertyInt16 = new CsdlProperty() .setName("PropertyInt16") .setType(nameInt16); - public static final Property propertyInt16_NotNullable = new Property() + public static final CsdlProperty propertyInt16_NotNullable = new CsdlProperty() .setName("PropertyInt16") .setType(nameInt16) .setNullable(false); - public static final Property propertyInt16_ExplicitNullable = new Property() + public static final CsdlProperty propertyInt16_ExplicitNullable = new CsdlProperty() .setName("PropertyInt16") .setType(nameInt16) .setNullable(true); - public static final Property propertyInt32 = new Property() + public static final CsdlProperty propertyInt32 = new CsdlProperty() .setName("PropertyInt32") .setType(nameInt32); - public static final Property propertyInt32_NotNullable = new Property() + public static final CsdlProperty propertyInt32_NotNullable = new CsdlProperty() .setName("PropertyInt32") .setType(nameInt32) .setNullable(false); - public static final Property propertyInt32_ExplicitNullable = new Property() + public static final CsdlProperty propertyInt32_ExplicitNullable = new CsdlProperty() .setName("PropertyInt32") .setType(nameInt32) .setNullable(true); - public static final Property propertyInt64 = new Property() + public static final CsdlProperty propertyInt64 = new CsdlProperty() .setName("PropertyInt64") .setType(nameInt64); - public static final Property propertyInt64_NotNullable = new Property() + public static final CsdlProperty propertyInt64_NotNullable = new CsdlProperty() .setName("PropertyInt64") .setType(nameInt64) .setNullable(false); - public static final Property propertyInt64_ExplicitNullable = new Property() + public static final CsdlProperty propertyInt64_ExplicitNullable = new CsdlProperty() .setName("PropertyInt64") .setType(nameInt64) .setNullable(true); - public static final Property propertySByte = new Property() + public static final CsdlProperty propertySByte = new CsdlProperty() .setName("PropertySByte") .setType(nameSByte); - public static final Property propertySByte_NotNullable = new Property() + public static final CsdlProperty propertySByte_NotNullable = new CsdlProperty() .setName("PropertySByte") .setType(nameSByte) .setNullable(false); - public static final Property propertySByte_ExplicitNullable = new Property() + public static final CsdlProperty propertySByte_ExplicitNullable = new CsdlProperty() .setName("PropertySByte") .setType(nameSByte) .setNullable(true); - public static final Property propertySingle = new Property() + public static final CsdlProperty propertySingle = new CsdlProperty() .setName("PropertySingle") .setType(nameSingle); - public static final Property propertySingle_NotNullable = new Property() + public static final CsdlProperty propertySingle_NotNullable = new CsdlProperty() .setName("PropertySingle") .setType(nameSingle) .setNullable(false); - public static final Property propertySingle_ExplicitNullable = new Property() + public static final CsdlProperty propertySingle_ExplicitNullable = new CsdlProperty() .setName("PropertySingle") .setType(nameSingle) .setNullable(true); - public static final Property propertyString = new Property() + public static final CsdlProperty propertyString = new CsdlProperty() .setName("PropertyString") .setType(nameString); - public static final Property propertyString_NotNullable = new Property() + public static final CsdlProperty propertyString_NotNullable = new CsdlProperty() .setName("PropertyString") .setType(nameString) .setNullable(false); - public static final Property propertyString_ExplicitNullable = new Property() + public static final CsdlProperty propertyString_ExplicitNullable = new CsdlProperty() .setName("PropertyString") .setType(nameString) .setNullable(true); - public static final Property propertyTimeOfDay = new Property() + public static final CsdlProperty propertyTimeOfDay = new CsdlProperty() .setName("PropertyTimeOfDay") .setType(nameTimeOfDay); - public static final Property propertyTimeOfDay_Precision = new Property() + public static final CsdlProperty propertyTimeOfDay_Precision = new CsdlProperty() .setName("PropertyTimeOfDay") .setPrecision(12) .setType(nameTimeOfDay); - public static final Property propertyTimeOfDay_NotNullable = new Property() + public static final CsdlProperty propertyTimeOfDay_NotNullable = new CsdlProperty() .setName("PropertyTimeOfDay") .setType(nameTimeOfDay) .setNullable(false); - public static final Property propertyTimeOfDay_ExplicitNullable = new Property() + public static final CsdlProperty propertyTimeOfDay_ExplicitNullable = new CsdlProperty() .setName("PropertyTimeOfDay") .setType(nameTimeOfDay) .setNullable(true); // Complex Properties ---------------------------------------------------------------------------------------------- - public static final Property collPropertyComp_CTPrimComp = new Property() + public static final CsdlProperty collPropertyComp_CTPrimComp = new CsdlProperty() .setName("CollPropertyComp") .setType(ComplexTypeProvider.nameCTPrimComp) .setCollection(true); - public static final Property collPropertyComp_CTTwoPrim = new Property() + public static final CsdlProperty collPropertyComp_CTTwoPrim = new CsdlProperty() .setName("CollPropertyComp") .setType(ComplexTypeProvider.nameCTTwoPrim) .setCollection(true); - public static final Property propertyComp_CTAllPrim = new Property() + public static final CsdlProperty propertyComp_CTAllPrim = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTAllPrim); - public static final Property propertyComp_CTCollAllPrim = new Property() + public static final CsdlProperty propertyComp_CTCollAllPrim = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTCollAllPrim); - public static final Property propertyComp_CTCompCollComp = new Property() + public static final CsdlProperty propertyComp_CTCompCollComp = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTCompCollComp); - public static final Property propertyComp_CTCompComp = new Property() + public static final CsdlProperty propertyComp_CTCompComp = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTCompComp); - public static final Property propertyComp_CTNavFiveProp = new Property() + public static final CsdlProperty propertyComp_CTNavFiveProp = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTNavFiveProp); - public static final Property propertyCompNav_CTNavFiveProp = new Property() + public static final CsdlProperty propertyCompNav_CTNavFiveProp = new CsdlProperty() .setName("PropertyCompNav") .setType(ComplexTypeProvider.nameCTNavFiveProp); - public static final Property propertyComp_CTPrimComp_NotNullable = new Property() + public static final CsdlProperty propertyComp_CTPrimComp_NotNullable = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTPrimComp) .setNullable(false); - public static final Property propertyComp_CTTwoPrim = new Property() + public static final CsdlProperty propertyComp_CTTwoPrim = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTTwoPrim); - public static final Property propertyComp_CTTwoPrim_NotNullable = new Property() + public static final CsdlProperty propertyComp_CTTwoPrim_NotNullable = new CsdlProperty() .setName("PropertyComp") .setType(ComplexTypeProvider.nameCTTwoPrim) .setNullable(false); - public static final Property propertyCompNavCont = new Property() + public static final CsdlProperty propertyCompNavCont = new CsdlProperty() .setName("PropertyCompNavCont") .setType(ComplexTypeProvider.nameCTNavCont); - public static final Property propertyCompAllPrim_CTAllPrim = new Property() + public static final CsdlProperty propertyCompAllPrim_CTAllPrim = new CsdlProperty() .setName("PropertyCompAllPrim") .setType(ComplexTypeProvider.nameCTAllPrim); - public static final Property propertyCompComp_CTCompComp = new Property() + public static final CsdlProperty propertyCompComp_CTCompComp = new CsdlProperty() .setName("PropertyCompComp") .setType(ComplexTypeProvider.nameCTCompComp); - public static final Property propertyCompComp_CTCompComp_NotNullable = new Property() + public static final CsdlProperty propertyCompComp_CTCompComp_NotNullable = new CsdlProperty() .setName("PropertyCompComp") .setType(ComplexTypeProvider.nameCTCompComp) .setNullable(false); - public static final Property propertyCompTwoPrim_CTTwoPrim = new Property() + public static final CsdlProperty propertyCompTwoPrim_CTTwoPrim = new CsdlProperty() .setName("PropertyCompTwoPrim") .setType(ComplexTypeProvider.nameCTTwoPrim); - public static final Property propertyMixedPrimCollComp_CTMixPrimCollComp = new Property() + public static final CsdlProperty propertyMixedPrimCollComp_CTMixPrimCollComp = new CsdlProperty() .setName("PropertyMixedPrimCollComp") .setType(ComplexTypeProvider.nameCTMixPrimCollComp); - public static final Property propertyComp_CTMixEnumTypeDefColl = new Property() + public static final CsdlProperty propertyComp_CTMixEnumTypeDefColl = new CsdlProperty() .setName("PropertyCompMixedEnumDef") .setType(ComplexTypeProvider.nameCTMixEnumDef); - public static final Property propertyCompColl_CTMixEnumTypeDefColl = new Property() + public static final CsdlProperty propertyCompColl_CTMixEnumTypeDefColl = new CsdlProperty() .setName("CollPropertyCompMixedEnumDef") .setType(ComplexTypeProvider.nameCTMixEnumDef) .setCollection(true); // Navigation Properties ------------------------------------------------------------------------------------------- - public static final NavigationProperty collectionNavPropertyETKeyNavMany_ETKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETKeyNavMany_ETKeyNav = new CsdlNavigationProperty() .setName("NavPropertyETKeyNavMany") .setType(EntityTypeProvider.nameETKeyNav) .setCollection(true); - public static final NavigationProperty collectionNavPropertyETMediaMany_ETMedia = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETMediaMany_ETMedia = new CsdlNavigationProperty() .setName("NavPropertyETMediaMany") .setType(EntityTypeProvider.nameETMedia) .setCollection(true); - public static final NavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav_WithPartnerERKeyNavOne = - new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav_WithPartnerERKeyNavOne = + new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavMany") .setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true) .setPartner("NavPropertyETKeyNavOne"); - public static final NavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav = + new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavMany") .setType(EntityTypeProvider.nameETTwoKeyNav) .setCollection(true); - public static final NavigationProperty collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav = + new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavOne") .setType(EntityTypeProvider.nameETTwoKeyNav); - public static final NavigationProperty collectionNavPropertyETTwoPrimMany_ETTwoPrim = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETTwoPrimMany_ETTwoPrim = + new CsdlNavigationProperty() .setName("NavPropertyETTwoPrimMany") .setType(EntityTypeProvider.nameETTwoPrim) .setCollection(true); - public static final NavigationProperty collectionNavPropertyETAllPrimMany_ETAllPrim = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETAllPrimMany_ETAllPrim = + new CsdlNavigationProperty() .setName("NavPropertyETAllPrimMany") .setType(EntityTypeProvider.nameETAllPrim) .setCollection(true); - public static final NavigationProperty collectionNavPropertySINav = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertySINav = new CsdlNavigationProperty() .setName("NavPropertySINav") .setCollection(true) .setType(EntityTypeProvider.nameETTwoKeyNav); - public static final NavigationProperty collectionNavPropertyETKeyNavContMany_CT_ETKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETKeyNavContMany_CT_ETKeyNav = + new CsdlNavigationProperty() .setName("NavPropertyETKeyNavContMany") .setCollection(true) .setContainsTarget(true) .setType(EntityTypeProvider.nameETKeyNav); - public static final NavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav = - new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav = + new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavContMany") .setCollection(true) .setContainsTarget(true) .setType(EntityTypeProvider.nameETKeyNav); - public static final NavigationProperty navPropertyETKeyNavOne_ETKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETKeyNavOne_ETKeyNav = new CsdlNavigationProperty() .setName("NavPropertyETKeyNavOne") .setType(EntityTypeProvider.nameETKeyNav); - public static final NavigationProperty navPropertyETMediaOne_ETMedia = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETMediaOne_ETMedia = new CsdlNavigationProperty() .setName("NavPropertyETMediaOne") .setType(EntityTypeProvider.nameETMedia); - public static final NavigationProperty navPropertyETKeyPrimNavOne_ETKeyPrimNav = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETKeyPrimNavOne_ETKeyPrimNav = new CsdlNavigationProperty() .setName("NavPropertyETKeyPrimNavOne") .setType(EntityTypeProvider.nameETKeyPrimNav); - public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable = + new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavOne") .setType(EntityTypeProvider.nameETTwoKeyNav) .setNullable(false); - public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav = new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavOne") .setType(EntityTypeProvider.nameETTwoKeyNav); - public static final NavigationProperty navPropertyETTwoPrimOne_ETTwoPrim = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETTwoPrimOne_ETTwoPrim = new CsdlNavigationProperty() .setName("NavPropertyETTwoPrimOne") .setType(EntityTypeProvider.nameETTwoPrim) .setNullable(false); - public static final NavigationProperty navPropertyETAllPrimOne_ETAllPrim = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETAllPrimOne_ETAllPrim = new CsdlNavigationProperty() .setName("NavPropertyETAllPrimOne") .setType(EntityTypeProvider.nameETAllPrim); - public static final NavigationProperty navPropertyETKeyNavContOne_CT_ETeyNav = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETKeyNavContOne_CT_ETeyNav = new CsdlNavigationProperty() .setName("NavPropertyETKeyNavContOne") .setContainsTarget(true) .setType(EntityTypeProvider.nameETKeyNav); - public static final NavigationProperty navPropertyETTwoKeyNavContOne_CT_ETKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOne_CT_ETKeyNav = new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavContOne") .setContainsTarget(true) .setType(EntityTypeProvider.nameETKeyNav); - public static final NavigationProperty navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav = new NavigationProperty() + public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav = new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavContOne") .setContainsTarget(true) .setType(EntityTypeProvider.nameETTwoKeyNav); - public static final NavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav = - new NavigationProperty() + public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav = + new CsdlNavigationProperty() .setName("NavPropertyETTwoKeyNavContMany") .setContainsTarget(true) .setCollection(true) .setType(EntityTypeProvider.nameETTwoKeyNav); // EnumProperties -------------------------------------------------------------------------------------------------- - public static final Property propertyEnumString_ENString = new Property() + public static final CsdlProperty propertyEnumString_ENString = new CsdlProperty() .setName("PropertyEnumString") .setType(EnumTypeProvider.nameENString) .setNullable(false); - public static final Property propertyEnumString_ENString_Nullable = new Property() + public static final CsdlProperty propertyEnumString_ENString_Nullable = new CsdlProperty() .setName("PropertyEnumString") .setType(EnumTypeProvider.nameENString); - public static final Property collPropertyEnumString_ENString = new Property() + public static final CsdlProperty collPropertyEnumString_ENString = new CsdlProperty() .setName("CollPropertyEnumString") .setType(EnumTypeProvider.nameENString) .setCollection(true); // TypeDefinition Properties --------------------------------------------------------------------------------------- - public static final Property propertyTypeDefinition_TDString = new Property() + public static final CsdlProperty propertyTypeDefinition_TDString = new CsdlProperty() .setName("PropertyDefString") .setType(TypeDefinitionProvider.nameTDString) .setMaxLength(15); - public static final Property collPropertyTypeDefinition_TDString = new Property() + public static final CsdlProperty collPropertyTypeDefinition_TDString = new CsdlProperty() .setName("CollPropertyDefString") .setType(TypeDefinitionProvider.nameTDString) .setMaxLength(15) diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java index 33f98a64a..7500a5a35 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java @@ -19,13 +19,13 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.commons.api.edm.provider.Action; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.EnumType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlAction; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import java.util.ArrayList; import java.util.List; @@ -40,25 +40,25 @@ public class SchemaProvider { this.prov = prov; } - public List getSchemas() throws ODataException { - List schemas = new ArrayList(); - Schema schema = new Schema(); + public List getSchemas() throws ODataException { + List schemas = new ArrayList(); + CsdlSchema schema = new CsdlSchema(); schema.setNamespace(NAMESPACE); schema.setAlias("Namespace1_Alias"); schemas.add(schema); // EnumTypes - List enumTypes = new ArrayList(); + List enumTypes = new ArrayList(); schema.setEnumTypes(enumTypes); // TypeDefinitions - List typeDefinitions = new ArrayList(); + List typeDefinitions = new ArrayList(); schema.setTypeDefinitions(typeDefinitions); typeDefinitions.add(prov.getTypeDefinition(TypeDefinitionProvider.nameTDString)); enumTypes.add(prov.getEnumType(EnumTypeProvider.nameENString)); // EntityTypes - List entityTypes = new ArrayList(); + List entityTypes = new ArrayList(); schema.setEntityTypes(entityTypes); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllPrim)); @@ -90,7 +90,7 @@ public class SchemaProvider { // ComplexTypes - List complexType = new ArrayList(); + List complexType = new ArrayList(); schema.setComplexTypes(complexType); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrim)); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTAllPrim)); @@ -111,7 +111,7 @@ public class SchemaProvider { // Actions - List actions = new ArrayList(); + List actions = new ArrayList(); schema.setActions(actions); actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNav)); actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRTETAllPrim)); @@ -134,7 +134,7 @@ public class SchemaProvider { actions.addAll(prov.getActions(ActionProvider.nameUARTTwoParam)); // Functions - List functions = new ArrayList(); + List functions = new ArrayList(); schema.setFunctions(functions); functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16)); diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java index 74cdbb1a4..3a357a243 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java @@ -20,15 +20,15 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; public class TypeDefinitionProvider { public static final FullQualifiedName nameTDString = new FullQualifiedName(SchemaProvider.NAMESPACE, "TDString"); - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) { + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) { if (nameTDString.equals(typeDefinitionName)) { - return new TypeDefinition().setName(nameTDString.getName()).setUnderlyingType( + return new CsdlTypeDefinition().setName(nameTDString.getName()).setUnderlyingType( EdmPrimitiveTypeKind.String.getFullQualifiedName()).setMaxLength(15); } return null; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java index 0ed13fe6a..20eb233c6 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java @@ -39,8 +39,8 @@ import org.apache.commons.io.IOUtils; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.http.HttpContentType; @@ -223,8 +223,8 @@ public class ODataHandlerTest { public void uriParserExceptionResultsInRightResponseEdmCause() throws Exception { final OData odata = OData.newInstance(); final ServiceMetadata serviceMetadata = odata.createServiceMetadata( - new AbstractEdmProvider() { - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + new CsdlAbstractEdmProvider() { + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { throw new ODataException("msg"); } diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java index 4a433c3d6..8c01c2133 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java @@ -45,7 +45,7 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.Mapping; +import org.apache.olingo.commons.api.edm.provider.CsdlMapping; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.core.edm.primitivetype.EdmDate; import org.apache.olingo.commons.core.edm.primitivetype.EdmDateTimeOffset; @@ -656,7 +656,7 @@ public class ODataJsonDeserializerEntityTest extends AbstractODataDeserializerTe propertyNames.add("PropertyDate"); propertyNames.add("PropertyDateTimeOffset"); when(entityType.getPropertyNames()).thenReturn(propertyNames); - Mapping mapping = new Mapping().setMappedJavaClass(Date.class); + CsdlMapping mapping = new CsdlMapping().setMappedJavaClass(Date.class); EdmProperty propertyDate = mock(EdmProperty.class); when(propertyDate.getName()).thenReturn("PropertyDate"); diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java index a48627dee..d1b739b93 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java @@ -21,11 +21,11 @@ package org.apache.olingo.server.core.uri.testutil; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; import org.apache.olingo.server.tecsvc.provider.EdmTechProvider; import java.util.Arrays; @@ -43,20 +43,20 @@ public class EdmTechTestProvider extends EdmTechProvider { public static final String NAMESPACE = "olingo.odata.test1"; public static final FullQualifiedName nameContainer = new FullQualifiedName(NAMESPACE, "Container"); - Property propertyAInt16 = new Property().setName("a").setType(nameInt16); - Property propertyBInt16 = new Property().setName("b").setType(nameInt16); - Property propertyCInt16 = new Property().setName("c").setType(nameInt16); - Property propertyDInt16 = new Property().setName("d").setType(nameInt16); - Property propertyEInt16 = new Property().setName("e").setType(nameInt16); - Property propertyFInt16 = new Property().setName("f").setType(nameInt16); + CsdlProperty propertyAInt16 = new CsdlProperty().setName("a").setType(nameInt16); + CsdlProperty propertyBInt16 = new CsdlProperty().setName("b").setType(nameInt16); + CsdlProperty propertyCInt16 = new CsdlProperty().setName("c").setType(nameInt16); + CsdlProperty propertyDInt16 = new CsdlProperty().setName("d").setType(nameInt16); + CsdlProperty propertyEInt16 = new CsdlProperty().setName("e").setType(nameInt16); + CsdlProperty propertyFInt16 = new CsdlProperty().setName("f").setType(nameInt16); public static final FullQualifiedName nameCTabc = new FullQualifiedName(NAMESPACE, "CTabc"); public static final FullQualifiedName nameETabc = new FullQualifiedName(NAMESPACE, "ETabc"); @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { if (complexTypeName.equals(nameCTabc)) { - return new ComplexType() + return new CsdlComplexType() .setName("CTabc") .setProperties(Arrays.asList( propertyAInt16, propertyBInt16, propertyCInt16, @@ -69,10 +69,10 @@ public class EdmTechTestProvider extends EdmTechProvider { } @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException { + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException { if (nameContainer.equals(entityContainer)) { if (name.equals("ESabc")) { - return new EntitySet() + return new CsdlEntitySet() .setName("ESabc") .setType(nameETabc); } @@ -82,11 +82,11 @@ public class EdmTechTestProvider extends EdmTechProvider { } @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { - List oneKeyPropertyInt16 = Arrays.asList(new PropertyRef().setName("a")); + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + List oneKeyPropertyInt16 = Arrays.asList(new CsdlPropertyRef().setName("a")); if (entityTypeName.equals(nameETabc)) { - return new EntityType() + return new CsdlEntityType() .setName("ETabc") .setProperties(Arrays.asList( propertyAInt16, propertyBInt16, propertyCInt16, diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java b/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java index 8036c8f9c..4d3ba9d70 100644 --- a/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java +++ b/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java @@ -25,19 +25,19 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.commons.api.edm.provider.EntitySet; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.NavigationProperty; -import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.provider.Property; -import org.apache.olingo.commons.api.edm.provider.PropertyRef; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.CsdlProperty; +import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; -public class CarsEdmProvider extends AbstractEdmProvider { +public class CarsEdmProvider extends CsdlAbstractEdmProvider { // Service Namespace public static final String NAMESPACE = "olingo.odata.sample"; @@ -58,39 +58,39 @@ public class CarsEdmProvider extends AbstractEdmProvider { public static final String ES_MANUFACTURER_NAME = "Manufacturers"; @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { if (ET_CAR.equals(entityTypeName)) { - return new EntityType() + return new CsdlEntityType() .setName(ET_CAR.getName()) .setKey(Arrays.asList( - new PropertyRef().setName("Id"))) + new CsdlPropertyRef().setName("Id"))) .setProperties( Arrays.asList( - new Property().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()), - new Property().setName("Model").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), - new Property().setName("ModelYear").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()) + new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()), + new CsdlProperty().setName("Model").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), + new CsdlProperty().setName("ModelYear").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()) .setMaxLength(4), - new Property().setName("Price").setType(EdmPrimitiveTypeKind.Decimal.getFullQualifiedName()) + new CsdlProperty().setName("Price").setType(EdmPrimitiveTypeKind.Decimal.getFullQualifiedName()) .setScale(2), - new Property().setName("Currency").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()) + new CsdlProperty().setName("Currency").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()) .setMaxLength(3) ) ).setNavigationProperties(Arrays.asList( - new NavigationProperty().setName("Manufacturer").setType(ET_MANUFACTURER) + new CsdlNavigationProperty().setName("Manufacturer").setType(ET_MANUFACTURER) ) ); } else if (ET_MANUFACTURER.equals(entityTypeName)) { - return new EntityType() + return new CsdlEntityType() .setName(ET_MANUFACTURER.getName()) .setKey(Arrays.asList( - new PropertyRef().setName("Id"))) + new CsdlPropertyRef().setName("Id"))) .setProperties(Arrays.asList( - new Property().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()), - new Property().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), - new Property().setName("Address").setType(CT_ADDRESS)) + new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()), + new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), + new CsdlProperty().setName("Address").setType(CT_ADDRESS)) ).setNavigationProperties(Arrays.asList( - new NavigationProperty().setName("Cars").setType(ET_CAR).setCollection(true) + new CsdlNavigationProperty().setName("Cars").setType(ET_CAR).setCollection(true) ) ); } @@ -98,36 +98,36 @@ public class CarsEdmProvider extends AbstractEdmProvider { return null; } - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { if (CT_ADDRESS.equals(complexTypeName)) { - return new ComplexType().setName(CT_ADDRESS.getName()).setProperties(Arrays.asList( - new Property().setName("Street").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), - new Property().setName("City").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), - new Property().setName("ZipCode").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), - new Property().setName("Country").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()) + return new CsdlComplexType().setName(CT_ADDRESS.getName()).setProperties(Arrays.asList( + new CsdlProperty().setName("Street").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), + new CsdlProperty().setName("City").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), + new CsdlProperty().setName("ZipCode").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()), + new CsdlProperty().setName("Country").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()) )); } return null; } @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) throws ODataException { if (CONTAINER_FQN.equals(entityContainer)) { if (ES_CARS_NAME.equals(entitySetName)) { - return new EntitySet() + return new CsdlEntitySet() .setName(ES_CARS_NAME) .setType(ET_CAR) .setNavigationPropertyBindings( Arrays.asList( - new NavigationPropertyBinding().setPath("Manufacturer").setTarget( + new CsdlNavigationPropertyBinding().setPath("Manufacturer").setTarget( CONTAINER_FQN.getFullQualifiedNameAsString() + "/" + ES_MANUFACTURER_NAME))); } else if (ES_MANUFACTURER_NAME.equals(entitySetName)) { - return new EntitySet() + return new CsdlEntitySet() .setName(ES_MANUFACTURER_NAME) .setType(ET_MANUFACTURER).setNavigationPropertyBindings( Arrays.asList( - new NavigationPropertyBinding().setPath("Cars") + new CsdlNavigationPropertyBinding().setPath("Cars") .setTarget(CONTAINER_FQN.getFullQualifiedNameAsString() + "/" + ES_CARS_NAME))); } } @@ -136,18 +136,18 @@ public class CarsEdmProvider extends AbstractEdmProvider { } @Override - public List getSchemas() throws ODataException { - List schemas = new ArrayList(); - Schema schema = new Schema(); + public List getSchemas() throws ODataException { + List schemas = new ArrayList(); + CsdlSchema schema = new CsdlSchema(); schema.setNamespace(NAMESPACE); // EntityTypes - List entityTypes = new ArrayList(); + List entityTypes = new ArrayList(); entityTypes.add(getEntityType(ET_CAR)); entityTypes.add(getEntityType(ET_MANUFACTURER)); schema.setEntityTypes(entityTypes); // ComplexTypes - List complexTypes = new ArrayList(); + List complexTypes = new ArrayList(); complexTypes.add(getComplexType(CT_ADDRESS)); schema.setComplexTypes(complexTypes); @@ -159,12 +159,12 @@ public class CarsEdmProvider extends AbstractEdmProvider { } @Override - public EntityContainer getEntityContainer() throws ODataException { - EntityContainer container = new EntityContainer(); + public CsdlEntityContainer getEntityContainer() throws ODataException { + CsdlEntityContainer container = new CsdlEntityContainer(); container.setName(CONTAINER_FQN.getName()); // EntitySets - List entitySets = new ArrayList(); + List entitySets = new ArrayList(); container.setEntitySets(entitySets); entitySets.add(getEntitySet(CONTAINER_FQN, ES_CARS_NAME)); entitySets.add(getEntitySet(CONTAINER_FQN, ES_MANUFACTURER_NAME)); @@ -173,9 +173,10 @@ public class CarsEdmProvider extends AbstractEdmProvider { } @Override - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException { if (entityContainerName == null || CONTAINER_FQN.equals(entityContainerName)) { - return new EntityContainerInfo().setContainerName(CONTAINER_FQN); + return new CsdlEntityContainerInfo().setContainerName(CONTAINER_FQN); } return null; }