mirror of
https://github.com/apache/olingo-odata4.git
synced 2025-03-06 16:49:09 +00:00
[OLINGO-264] More client-side tests
This commit is contained in:
parent
726fbe52e3
commit
3b3660025e
75
fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java
Normal file
75
fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.olingo.fit;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
import org.apache.olingo.fit.utils.Accept;
|
||||
import org.apache.olingo.fit.utils.ConstantKey;
|
||||
import org.apache.olingo.fit.utils.Constants;
|
||||
import org.apache.olingo.fit.utils.FSManager;
|
||||
import org.apache.olingo.fit.utils.XMLUtilities;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Path("/V40/Vocabularies.svc")
|
||||
public class V4Vocabularies {
|
||||
|
||||
private final XMLUtilities xml;
|
||||
|
||||
public V4Vocabularies() throws Exception {
|
||||
this.xml = new XMLUtilities(ODataServiceVersion.V40);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/$metadata")
|
||||
@Produces(MediaType.APPLICATION_XML)
|
||||
public Response getMetadata() {
|
||||
try {
|
||||
return xml.createResponse(
|
||||
null,
|
||||
FSManager.instance(ODataServiceVersion.V40).readFile(
|
||||
"vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
|
||||
null,
|
||||
Accept.XML);
|
||||
} catch (Exception e) {
|
||||
return xml.createFaultResponse(Accept.XML.toString(ODataServiceVersion.V40), e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{vocabulary}")
|
||||
@Produces(MediaType.APPLICATION_XML)
|
||||
public Response getVocabulary(@PathParam("vocabulary") final String vocabulary) {
|
||||
try {
|
||||
return xml.createResponse(
|
||||
null,
|
||||
FSManager.instance(ODataServiceVersion.V40).readFile(vocabulary, null),
|
||||
null,
|
||||
Accept.XML);
|
||||
} catch (Exception e) {
|
||||
return xml.createFaultResponse(Accept.XML.toString(ODataServiceVersion.V40), e);
|
||||
}
|
||||
}
|
||||
}
|
326
fit/src/main/resources/V40/Org.OData.Capabilities.V1.xml
Normal file
326
fit/src/main/resources/V40/Org.OData.Capabilities.V1.xml
Normal file
@ -0,0 +1,326 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/Vocabularies.svc/Org.OData.Core.V1.xml">
|
||||
<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1" />
|
||||
</edmx:Reference>
|
||||
<edmx:DataServices>
|
||||
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Org.OData.Capabilities.V1" Alias="Capabilities">
|
||||
<Annotation Term="Core.Description">
|
||||
<String>
|
||||
The Capabilities vocabulary aims to provide a way for service authors to describe
|
||||
certain capabilities of an OData Service.
|
||||
</String>
|
||||
</Annotation>
|
||||
<Annotation Term="Core.LongDescription">
|
||||
<String>
|
||||
There are some capabilities which are strongly recommended for services to support even
|
||||
though they are optional. Support for $top and $skip is a good example as
|
||||
supporting these query options helps with performance of a service and are essential. Such
|
||||
capabilities are assumed to be default capabilities of an OData service even in
|
||||
the case that a capabilities annotation doesn’t exist. Capabilities annotations are
|
||||
mainly expected to be used to explicitly specify that a service doesn’t support such
|
||||
capabilities. Capabilities annotations can as well be used to declaratively
|
||||
specify the support of such capabilities.
|
||||
|
||||
On the other hand, there are some capabilities that a service may choose to support or
|
||||
not support and in varying degrees. $filter and $orderby are such good examples.
|
||||
This vocabulary aims to define terms to specify support or no support for such
|
||||
capabilities.
|
||||
|
||||
A service is assumed to support by default the following capabilities even though an
|
||||
annotation doesn’t exist:
|
||||
- Countability ($count, $inlinecount)
|
||||
- Client pageability ($top, $skip)
|
||||
- Expandability ($expand)
|
||||
- Indexability by key
|
||||
- Batch support ($batch)
|
||||
- Navigability of navigation properties
|
||||
|
||||
A service is expected to support the following capabilities. If not supported, the
|
||||
service is expected to call out the restrictions using annotations:
|
||||
- Filterability ($filter)
|
||||
- Sortability ($orderby)
|
||||
- Queryability of top level entity sets
|
||||
- Query functions
|
||||
|
||||
A client cannot assume that a service supports certain capabilities. A client can try, but
|
||||
it needs to be prepared to handle an error in case the following capabilities are not
|
||||
supported:
|
||||
- Insertability
|
||||
- Updatability
|
||||
- Deletability
|
||||
</String>
|
||||
</Annotation>
|
||||
|
||||
<!-- Conformance Level -->
|
||||
|
||||
<Term Name="ConformanceLevel" Type="Capabilities.ConformanceLevelType" AppliesTo="EntityContainer" />
|
||||
<EnumType Name="ConformanceLevelType">
|
||||
<Member Name="Minimal" />
|
||||
<Member Name="Intermediate" />
|
||||
<Member Name="Advanced" />
|
||||
</EnumType>
|
||||
|
||||
<!-- Request Capabilities -->
|
||||
|
||||
<Term Name="SupportedFormats" Type="Collection(Edm.String)">
|
||||
<Annotation Term="Core.Description" String="Media types of supported formats, including format parameters" />
|
||||
<Annotation Term="Core.IsMediaType" />
|
||||
</Term>
|
||||
|
||||
<Term Name="AcceptableEncodings" Type="Collection(Edm.String)" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="List of acceptable compression methods for ($batch) requests, e.g. gzip" />
|
||||
</Term>
|
||||
|
||||
<!-- Supported Preferences -->
|
||||
|
||||
<Term Name="AsynchronousRequestsSupported" Type="Core.Tag" DefaultValue="true" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Service supports the asynchronous request preference" />
|
||||
</Term>
|
||||
|
||||
<Term Name="BatchContinueOnErrorSupported" Type="Core.Tag" DefaultValue="true" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Service supports the continue on error preference" />
|
||||
</Term>
|
||||
|
||||
<Term Name="IsolationSupported" Type="Capabilities.IsolationLevel" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Supported odata.isolation levels" />
|
||||
</Term>
|
||||
<EnumType Name="IsolationLevel" IsFlags="true">
|
||||
<Member Name="Snapshot" Value="1" />
|
||||
</EnumType>
|
||||
|
||||
<Term Name="CallbackSupported" Type="Capabilities.CallbackType" AppliesTo="EntityContainer EntitySet">
|
||||
<Annotation Term="Core.Description" String="Supports callbacks for the specified protocols" />
|
||||
</Term>
|
||||
<Term Name="CrossJoinSupported" Type="Core.Tag" DefaultValue="true" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Supports cross joins for the entity sets in this container" />
|
||||
</Term>
|
||||
<ComplexType Name="CallbackType">
|
||||
<Property Name="CallbackProtocols" Type="Collection(Capabilities.CallbackProtocol)" />
|
||||
<Annotation Term="Core.Description"
|
||||
String="A non-empty collection lists the full set of supported protocols. A empty collection means 'only HTTP is supported'" />
|
||||
</ComplexType>
|
||||
<ComplexType Name="CallbackProtocol">
|
||||
<Property Name="Id" Type="Edm.String">
|
||||
<Annotation Term="Core.Description" String="Protcol Identifier" />
|
||||
</Property>
|
||||
<Property Name="UrlTemplate" Type="Edm.String">
|
||||
<Annotation Term="Core.Description"
|
||||
String="URL Template including parameters. Parameters are enclosed in curly braces {} as defined in RFC6570" />
|
||||
</Property>
|
||||
<Property Name="DocumentationUrl" Type="Edm.String" Nullable="true">
|
||||
<Annotation Term="Core.Description" String="Human readable description of the meaning of the URL Template parameters" />
|
||||
<Annotation Term="Core.IsURL" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="ChangeTracking" Type="Capabilities.ChangeTrackingType" AppliesTo="EntityContainer EntitySet">
|
||||
<Annotation Term="Core.Description" String="Change tracking capabilities of this service or entity set" />
|
||||
</Term>
|
||||
<ComplexType Name="ChangeTrackingType">
|
||||
<Property Name="Supported" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="This entity set supports the odata.track-changes preference" />
|
||||
</Property>
|
||||
<Property Name="FilterableProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description" String="Change tracking supports filters on these properties" />
|
||||
</Property>
|
||||
<Property Name="ExpandableProperties" Type="Collection(Edm.NavigationPropertyPath)">
|
||||
<Annotation Term="Core.Description" String="Change tracking supports these properties expanded" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<!--Query Capabilities -->
|
||||
|
||||
<Term Name="CountRestrictions" Type="Capabilities.CountRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on /$count path suffix and $count=true system query option" />
|
||||
</Term>
|
||||
<ComplexType Name="CountRestrictionsType">
|
||||
<Property Name="Countable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="Entities can be counted" />
|
||||
</Property>
|
||||
<Property Name="NonCountableProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These collection properties do not allow /$count segments" />
|
||||
</Property>
|
||||
<Property Name="NonCountableNavigationProperties" Type="Collection(Edm.NavigationPropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These navigation properties do not allow /$count segments" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="NavigationRestrictions" Type="Capabilities.NavigationRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on navigating properties according to OData URL conventions" />
|
||||
</Term>
|
||||
<ComplexType Name="NavigationRestrictionsType">
|
||||
<Property Name="Navigability" Type="Capabilities.NavigationType">
|
||||
<Annotation Term="Core.Description" String="Supported Navigability" />
|
||||
</Property>
|
||||
<Property Name="RestrictedProperties" Type="Collection(Capabilities.NavigationPropertyRestriction)" />
|
||||
</ComplexType>
|
||||
<ComplexType Name="NavigationPropertyRestriction">
|
||||
<Property Name="NavigationProperty" Type="Edm.NavigationPropertyPath">
|
||||
<Annotation Term="Core.Description" String="Navigation properties can be navigated to a single level" />
|
||||
</Property>
|
||||
<Property Name="Navigability" Type="Capabilities.NavigationType">
|
||||
<Annotation Term="Core.Description" String="Navigation properties can be navigated to a single level" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
<EnumType Name="NavigationType">
|
||||
<Member Name="Recursive">
|
||||
<Annotation Term="Core.Description" String="Navigation properties can be recursively navigated" />
|
||||
</Member>
|
||||
<Member Name="Single">
|
||||
<Annotation Term="Core.Description" String="Navigation properties can be navigated to a single level" />
|
||||
</Member>
|
||||
<Member Name="None">
|
||||
<Annotation Term="Core.Description" String="Navigation properties are not navigable" />
|
||||
</Member>
|
||||
</EnumType>
|
||||
|
||||
<Term Name="IndexableByKey" Type="Core.Tag" DefaultValue="true" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Supports key values according to OData URL conventions" />
|
||||
</Term>
|
||||
|
||||
<Term Name="TopSupported" Type="Core.Tag" DefaultValue="true" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Supports $top" />
|
||||
</Term>
|
||||
<Term Name="SkipSupported" Type="Core.Tag" DefaultValue="true" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Supports $skip" />
|
||||
</Term>
|
||||
|
||||
<Term Name="BatchSupported" Type="Core.Tag" DefaultValue="true" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Supports $batch requests" />
|
||||
</Term>
|
||||
|
||||
<Term Name="FilterFunctions" Type="Collection(Edm.String)" AppliesTo="EntityContainer EntitySet">
|
||||
<Annotation Term="Core.Description" String="List of functions supported in $filter" />
|
||||
</Term>
|
||||
|
||||
<Term Name="FilterRestrictions" Type="Capabilities.FilterRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on $filter expressions" />
|
||||
</Term>
|
||||
<ComplexType Name="FilterRestrictionsType">
|
||||
<Property Name="Filterable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="$filter is supported" />
|
||||
</Property>
|
||||
<Property Name="RequiresFilter" Type="Edm.Boolean" Nullable="true">
|
||||
<Annotation Term="Core.Description" String="$filter is required" />
|
||||
</Property>
|
||||
<Property Name="RequiredProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description"
|
||||
String="These properties must be specified in the $filter clause (properties of derived types are not allowed here)" />
|
||||
</Property>
|
||||
<Property Name="NonFilterableProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These properties cannot be used in $filter expressions" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="SortRestrictions" Type="Capabilities.SortRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on $orderby expressions" />
|
||||
</Term>
|
||||
<ComplexType Name="SortRestrictionsType">
|
||||
<Property Name="Sortable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="$orderby is supported" />
|
||||
</Property>
|
||||
<Property Name="AscendingOnlyProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These properties can only be used for sorting in Ascending order" />
|
||||
</Property>
|
||||
<Property Name="DescendingOnlyProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These properties can only be used for sorting in Descending order" />
|
||||
</Property>
|
||||
<Property Name="NonSortableProperties" Type="Collection(Edm.PropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These properties cannot be used in $orderby expressions" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="ExpandRestrictions" Type="Capabilities.ExpandRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on $expand expressions" />
|
||||
</Term>
|
||||
<ComplexType Name="ExpandRestrictionsType">
|
||||
<Property Name="Expandable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="$expand is supported" />
|
||||
</Property>
|
||||
<Property Name="NonExpandableProperties" Type="Collection(Edm.NavigationPropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These properties cannot be used in $expand expressions" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="SearchRestrictions" Type="Capabilities.SearchRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on $search expressions" />
|
||||
</Term>
|
||||
<ComplexType Name="SearchRestrictionsType">
|
||||
<Property Name="Searchable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="$search is supported" />
|
||||
</Property>
|
||||
<Property Name="UnsupportedExpressions" Type="Capabilities.SearchExpressions" DefaultValue="none">
|
||||
<Annotation Term="Core.Description" String="Expressions supported in $search" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
<EnumType Name="SearchExpressions" IsFlags="true">
|
||||
<Member Name="none" Value="0" />
|
||||
<Member Name="AND" Value="1" />
|
||||
<Member Name="OR" Value="2" />
|
||||
<Member Name="NOT" Value="4" />
|
||||
<Member Name="phrase" Value="8" />
|
||||
<Member Name="group" Value="16" />
|
||||
</EnumType>
|
||||
|
||||
<!-- Data Modification Capabilities -->
|
||||
|
||||
<Term Name="InsertRestrictions" Type="Capabilities.InsertRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on insert operations" />
|
||||
</Term>
|
||||
<ComplexType Name="InsertRestrictionsType">
|
||||
<Property Name="Insertable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="Entities can be inserted" />
|
||||
</Property>
|
||||
<Property Name="NonInsertableNavigationProperties" Type="Collection(Edm.NavigationPropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These navigation properties do not allow deep inserts" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="UpdateRestrictions" Type="Capabilities.UpdateRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on update operations" />
|
||||
</Term>
|
||||
<ComplexType Name="UpdateRestrictionsType">
|
||||
<Property Name="Updatable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="Entities can be updated" />
|
||||
</Property>
|
||||
<Property Name="NonUpdatableNavigationProperties" Type="Collection(Edm.NavigationPropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These navigation properties do not allow rebinding" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
<Term Name="DeleteRestrictions" Type="Capabilities.DeleteRestrictionsType" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description" String="Restrictions on delete operations" />
|
||||
</Term>
|
||||
<ComplexType Name="DeleteRestrictionsType">
|
||||
<Property Name="Deletable" Type="Edm.Boolean" DefaultValue="true">
|
||||
<Annotation Term="Core.Description" String="Entities can be deleted" />
|
||||
</Property>
|
||||
<Property Name="NonDeletableNavigationProperties" Type="Collection(Edm.NavigationPropertyPath)">
|
||||
<Annotation Term="Core.Description" String="These navigation properties do not allow DeleteLink requests" />
|
||||
</Property>
|
||||
</ComplexType>
|
||||
|
||||
</Schema>
|
||||
</edmx:DataServices>
|
||||
</edmx:Edmx>
|
125
fit/src/main/resources/V40/Org.OData.Core.V1.xml
Normal file
125
fit/src/main/resources/V40/Org.OData.Core.V1.xml
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
|
||||
<edmx:DataServices>
|
||||
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Org.OData.Core.V1" Alias="Core">
|
||||
<Annotation Term="Core.Description">
|
||||
<String>Core terms needed to write vocabularies</String>
|
||||
</Annotation>
|
||||
|
||||
<!--Documentation -->
|
||||
|
||||
<Term Name="Description" Type="Edm.String">
|
||||
<Annotation Term="Core.Description" String="A brief description of a model element" />
|
||||
<Annotation Term="Core.IsLanguageDependent" />
|
||||
</Term>
|
||||
|
||||
<Term Name="LongDescription" Type="Edm.String">
|
||||
<Annotation Term="Core.Description" String="A lengthy description of a model element" />
|
||||
<Annotation Term="Core.IsLanguageDependent" />
|
||||
</Term>
|
||||
|
||||
<!-- Localization -->
|
||||
|
||||
<Term Name="IsLanguageDependent" Type="Core.Tag" DefaultValue="true" AppliesTo="Property Term">
|
||||
<Annotation Term="Core.Description" String="Properties and terms annotated with this term are language-dependent" />
|
||||
<Annotation Term="Core.RequiresType" String="Edm.String" />
|
||||
</Term>
|
||||
|
||||
<!-- Term Restrictions -->
|
||||
|
||||
<TypeDefinition Name="Tag" UnderlyingType="Edm.Boolean">
|
||||
<Annotation Term="Core.Description" String="This is the type to use for all tagging terms" />
|
||||
</TypeDefinition>
|
||||
|
||||
<Term Name="RequiresType" Type="Edm.String" AppliesTo="Term">
|
||||
<Annotation Term="Core.Description"
|
||||
String="Properties and terms annotated with this annotation MUST have a type that is identical to or derived from the given type name" />
|
||||
</Term>
|
||||
|
||||
<!--Resource Paths -->
|
||||
|
||||
<Term Name="ResourcePath" Type="Edm.String" AppliesTo="EntitySet Singleton ActionImport FunctionImport">
|
||||
<Annotation Term="Core.Description"
|
||||
String="Resource path for entity container child, can be relative to xml:base and the request URL" />
|
||||
<Annotation Term="Core.IsUrl" />
|
||||
</Term>
|
||||
|
||||
<Term Name="DereferenceableIDs" Type="Core.Tag" DefaultValue="true" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Entity-ids are URLs that locate the identified entity" />
|
||||
</Term>
|
||||
|
||||
<Term Name="ConventionalIDs" Type="Core.Tag" DefaultValue="true" AppliesTo="EntityContainer">
|
||||
<Annotation Term="Core.Description" String="Entity-ids follow OData URL conventions" />
|
||||
</Term>
|
||||
|
||||
<!-- Permissions -->
|
||||
|
||||
<Term Name="Permissions" Type="Core.Permission" AppliesTo="Property">
|
||||
<Annotation Term="Core.Description" String="Permissions available for a property.The value of 2 is reserved for future use." />
|
||||
</Term>
|
||||
<EnumType Name="Permission" IsFlags="true">
|
||||
<Member Name="None" Value="0" />
|
||||
<Member Name="Read" Value="1" />
|
||||
<Member Name="ReadWrite" Value="3" />
|
||||
</EnumType>
|
||||
|
||||
<!-- Metadata Extensions -->
|
||||
|
||||
<Term Name="Immutable" Type="Core.Tag" DefaultValue="true" AppliesTo="Property">
|
||||
<Annotation Term="Core.Description"
|
||||
String="A value for this non-key property can be provided on insert and remains unchanged on update" />
|
||||
</Term>
|
||||
|
||||
<Term Name="Computed" Type="Core.Tag" DefaultValue="true" AppliesTo="Property">
|
||||
<Annotation Term="Core.Description" String="A value for this property is generated on both insert and update" />
|
||||
</Term>
|
||||
|
||||
<Term Name="IsURL" Type="Core.Tag" DefaultValue="true" AppliesTo="Property Term">
|
||||
<Annotation Term="Core.Description" String="Properties and terms annotated with this term MUST contain a valid URL" />
|
||||
<Annotation Term="Core.RequiresType" String="Edm.String" />
|
||||
</Term>
|
||||
|
||||
<Term Name="AcceptableMediaTypes" Type="Collection(Edm.String)" AppliesTo="EntityType Property">
|
||||
<Annotation Term="Core.Description"
|
||||
String="Lists the MIME types acceptable for the annotated entity type marked with HasStream="true" or the annotated stream property" />
|
||||
<Annotation Term="Core.IsMediaType" />
|
||||
</Term>
|
||||
|
||||
<Term Name="MediaType" Type="Edm.String" AppliesTo="Property">
|
||||
<Annotation Term="Core.IsMediaType" />
|
||||
<Annotation Term="Core.RequiresType" String="Edm.Binary" />
|
||||
</Term>
|
||||
|
||||
<Term Name="IsMediaType" Type="Core.Tag" DefaultValue="true" AppliesTo="Property Term">
|
||||
<Annotation Term="Core.Description" String="Properties and terms annotated with this term MUST contain a valid MIME type" />
|
||||
<Annotation Term="Core.RequiresType" String="Edm.String" />
|
||||
</Term>
|
||||
|
||||
<Term Name="OptimisticConcurrency" Type="Collection(Edm.PropertyPath)" AppliesTo="EntitySet">
|
||||
<Annotation Term="Core.Description"
|
||||
String="Data modification requires the use of Etags. A non-empty collection contains the set of properties that are used to compute the ETag" />
|
||||
</Term>
|
||||
|
||||
</Schema>
|
||||
</edmx:DataServices>
|
||||
</edmx:Edmx>
|
48
fit/src/main/resources/V40/Org.OData.Measures.V1.xml
Normal file
48
fit/src/main/resources/V40/Org.OData.Measures.V1.xml
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/Vocabularies.svc/Org.OData.Core.V1.xml">
|
||||
<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1" />
|
||||
</edmx:Reference>
|
||||
<edmx:DataServices>
|
||||
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Org.OData.Measures.V1" Alias="Measures">
|
||||
<Annotation Term="Core.Description">
|
||||
<String>Terms describing monetary amounts and measured quantities</String>
|
||||
</Annotation>
|
||||
|
||||
<Term Name="ISOCurrency" Type="Edm.String" AppliesTo="Property">
|
||||
<Annotation Term="Core.Description" String="The currency for this monetary amount as an ISO 4217 currency code" />
|
||||
</Term>
|
||||
|
||||
<Term Name="Scale" Type="Edm.Byte" AppliesTo="Property">
|
||||
<Annotation Term="Core.Description"
|
||||
String="The number of significant decimal places in the scale part (less than or equal to the number declared in the Scale facet)" />
|
||||
<Annotation Term="Core.RequiresType" String="Edm.Decimal" />
|
||||
</Term>
|
||||
|
||||
<Term Name="Unit" Type="Edm.String" AppliesTo="Property">
|
||||
<Annotation Term="Core.Description" String="The unit of measure for this measured quantity, e.g. cm for centimeters or % for percentages" />
|
||||
</Term>
|
||||
|
||||
</Schema>
|
||||
</edmx:DataServices>
|
||||
</edmx:Edmx>
|
@ -20,7 +20,7 @@
|
||||
|
||||
-->
|
||||
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/NorthWindExt.svc">
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/NorthWindExt.svc/$metadata">
|
||||
<edmx:Include Namespace="NorthwindModel"/>
|
||||
</edmx:Reference>
|
||||
<edmx:DataServices>
|
||||
|
37
fit/src/main/resources/V40/vocabularies-metadata.xml
Normal file
37
fit/src/main/resources/V40/vocabularies-metadata.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/Vocabularies.svc/Org.OData.Core.V1.xml">
|
||||
<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
|
||||
</edmx:Reference>
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/Vocabularies.svc/Org.OData.Measures.V1.xml">
|
||||
<edmx:Include Alias="UoM" Namespace="Org.OData.Measures.V1"/>
|
||||
</edmx:Reference>
|
||||
<edmx:Reference Uri="http://localhost:${cargo.servlet.port}/StaticService/V40/Vocabularies.svc/Org.OData.Capabilities.V1.xml">
|
||||
<edmx:Include Alias="Capabilities" Namespace="Org.OData.Capabilities.V1"/>
|
||||
</edmx:Reference>
|
||||
|
||||
<edmx:DataServices>
|
||||
<Schema Namespace="Vocabularies" xmlns="http://docs.oasis-open.org/odata/ns/edm">
|
||||
</Schema>
|
||||
</edmx:DataServices>
|
||||
</edmx:Edmx>
|
@ -48,6 +48,7 @@
|
||||
<bean class="org.apache.olingo.fit.V4NorthWind"/>
|
||||
<bean class="org.apache.olingo.fit.V4NorthWindExt"/>
|
||||
<bean class="org.apache.olingo.fit.V4OpenType"/>
|
||||
<bean class="org.apache.olingo.fit.V4Vocabularies"/>
|
||||
</jaxrs:serviceBeans>
|
||||
<jaxrs:providers>
|
||||
<bean class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
|
||||
|
@ -1,35 +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.fit;
|
||||
|
||||
import org.apache.olingo.client.api.CommonODataClient;
|
||||
|
||||
public abstract class AbstractMetadataTestITCase {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
protected abstract CommonODataClient getClient();
|
||||
|
||||
protected String getTestServiceRoot() {
|
||||
return "http://localhost:9080/StaticService/" + getClient().getServiceVersion().name() + "/Static.svc";
|
||||
}
|
||||
|
||||
protected String getNorthwindServiceRoot() {
|
||||
return "http://localhost:9080/StaticService/" + getClient().getServiceVersion().name() + "/NorthWind.svc";
|
||||
}
|
||||
}
|
@ -18,24 +18,16 @@
|
||||
*/
|
||||
package org.apache.olingo.fit.v3;
|
||||
|
||||
import org.apache.olingo.client.api.v3.ODataClient;
|
||||
import org.apache.olingo.client.core.ODataClientFactory;
|
||||
import org.apache.olingo.fit.AbstractMetadataTestITCase;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.Test;
|
||||
|
||||
public class MetadataTestITCase extends AbstractMetadataTestITCase {
|
||||
|
||||
@Override
|
||||
protected ODataClient getClient() {
|
||||
return ODataClientFactory.getV3();
|
||||
}
|
||||
public class MetadataTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void retrieve() {
|
||||
final Edm metadata = getClient().getRetrieveRequestFactory().
|
||||
getMetadataRequest(getTestServiceRoot()).execute().getBody();
|
||||
getMetadataRequest(testStaticServiceRootURL).execute().getBody();
|
||||
assertNotNull(metadata);
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,10 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
|
||||
|
||||
protected static String testStaticServiceRootURL;
|
||||
|
||||
protected static String testVocabulariesServiceRootURL;
|
||||
|
||||
protected static String testNorthwindRootURL;
|
||||
|
||||
protected static String testKeyAsSegmentServiceRootURL;
|
||||
|
||||
protected static String testOpenTypeServiceRootURL;
|
||||
@ -60,12 +64,14 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
|
||||
@BeforeClass
|
||||
public static void setUpODataServiceRoot() throws IOException {
|
||||
testStaticServiceRootURL = "http://localhost:9080/StaticService/V40/Static.svc";
|
||||
testVocabulariesServiceRootURL = "http://localhost:9080/StaticService/V40/Vocabularies.svc";
|
||||
testNorthwindRootURL = "http://localhost:9080/StaticService/V40/NorthWind.svc";
|
||||
testKeyAsSegmentServiceRootURL = "http://localhost:9080/StaticService/V40/KeyAsSegment.svc";
|
||||
testOpenTypeServiceRootURL = "http://localhost:9080/StaticService/V40/OpenType.svc";
|
||||
testLargeModelServiceRootURL = "http://localhost:9080/StaticService/V40/Static.svc/large";
|
||||
testAuthServiceRootURL = "http://localhost:9080/DefaultService.svc";
|
||||
|
||||
edmClient = ODataClientFactory.getEdmEnabledV4(testStaticServiceRootURL);
|
||||
edmClient = ODataClientFactory.getEdmEnabledV4(testStaticServiceRootURL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,29 +20,28 @@ package org.apache.olingo.fit.v4;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.apache.olingo.client.api.v4.ODataClient;
|
||||
import org.apache.olingo.client.core.ODataClientFactory;
|
||||
import org.apache.olingo.fit.AbstractMetadataTestITCase;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
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.EdmEnumType;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
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.core.edm.primitivetype.EdmBoolean;
|
||||
import org.junit.Test;
|
||||
|
||||
public class MetadataTestITCase extends AbstractMetadataTestITCase {
|
||||
|
||||
@Override
|
||||
protected ODataClient getClient() {
|
||||
return ODataClientFactory.getV4();
|
||||
}
|
||||
public class MetadataTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void retrieve() {
|
||||
final Edm metadata = getClient().getRetrieveRequestFactory().
|
||||
getMetadataRequest(getTestServiceRoot()).execute().getBody();
|
||||
final Edm metadata = client.getRetrieveRequestFactory().
|
||||
getMetadataRequest(testStaticServiceRootURL).execute().getBody();
|
||||
assertNotNull(metadata);
|
||||
|
||||
final EdmEntityType order = metadata.getEntityType(
|
||||
@ -56,11 +55,11 @@ public class MetadataTestITCase extends AbstractMetadataTestITCase {
|
||||
|
||||
@Test
|
||||
public void include() {
|
||||
final Edm metadata = getClient().getRetrieveRequestFactory().
|
||||
getMetadataRequest(getNorthwindServiceRoot()).execute().getBody();
|
||||
assertNotNull(metadata);
|
||||
final Edm edm = client.getRetrieveRequestFactory().
|
||||
getMetadataRequest(testNorthwindRootURL).execute().getBody();
|
||||
assertNotNull(edm);
|
||||
|
||||
final EdmEntityContainer container = metadata.getEntityContainer(
|
||||
final EdmEntityContainer container = edm.getEntityContainer(
|
||||
new FullQualifiedName("ODataWebExperimental.Northwind.Model", "NorthwindEntities"));
|
||||
assertNotNull(container);
|
||||
|
||||
@ -68,4 +67,57 @@ public class MetadataTestITCase extends AbstractMetadataTestITCase {
|
||||
assertNotNull(categories);
|
||||
assertEquals("NorthwindModel", categories.getEntityType().getNamespace());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void vocabularies() {
|
||||
final Edm edm = client.getRetrieveRequestFactory().
|
||||
getMetadataRequest(testVocabulariesServiceRootURL).execute().getBody();
|
||||
assertNotNull(edm);
|
||||
|
||||
// 1. core
|
||||
final EdmSchema core = edm.getSchema("Org.OData.Core.V1");
|
||||
assertNotNull(core);
|
||||
final EdmSchema coreAlias = edm.getSchema("Core");
|
||||
assertEquals(core, coreAlias);
|
||||
|
||||
final EdmTerm descriptionTerm = edm.getTerm(new FullQualifiedName("Core.Description"));
|
||||
assertNotNull(descriptionTerm);
|
||||
assertEquals(descriptionTerm.getFullQualifiedName(),
|
||||
edm.getTerm(new FullQualifiedName("Org.OData.Core.V1.Description")).getFullQualifiedName());
|
||||
|
||||
final EdmAnnotation description = core.getAnnotation(descriptionTerm);
|
||||
assertNotNull(description);
|
||||
assertEquals("Core terms needed to write vocabularies",
|
||||
description.getExpression().asConstant().getValue().asPrimitive().toString());
|
||||
|
||||
final EdmTerm isLanguageDependent = edm.getTerm(new FullQualifiedName("Core.IsLanguageDependent"));
|
||||
assertNotNull(isLanguageDependent);
|
||||
assertTrue(isLanguageDependent.getAppliesTo().contains(EdmProperty.class));
|
||||
assertTrue(isLanguageDependent.getAppliesTo().contains(EdmTerm.class));
|
||||
assertEquals(edm.getTypeDefinition(new FullQualifiedName("Core.Tag")), isLanguageDependent.getType());
|
||||
assertEquals(EdmBoolean.getInstance(), ((EdmTypeDefinition) isLanguageDependent.getType()).getUnderlyingType());
|
||||
assertNotNull(isLanguageDependent.getAnnotation(descriptionTerm));
|
||||
|
||||
final EdmTerm permissions = edm.getTerm(new FullQualifiedName("Core.Permissions"));
|
||||
assertNotNull(permissions);
|
||||
assertTrue(permissions.getType() instanceof EdmEnumType);
|
||||
|
||||
// 2. measures
|
||||
final EdmSchema measures = edm.getSchema("Measures");
|
||||
assertNotNull(measures);
|
||||
|
||||
final EdmTerm scale = edm.getTerm(new FullQualifiedName("Measures.Scale"));
|
||||
assertNotNull(scale);
|
||||
|
||||
final EdmAnnotation requiresTypeInScale = edm.getAnnotation(
|
||||
scale.getFullQualifiedName(), edm.getTerm(new FullQualifiedName("Core.RequiresType")));
|
||||
assertNotNull(requiresTypeInScale);
|
||||
assertEquals("Edm.Decimal", requiresTypeInScale.getExpression().asConstant().getValue().toString());
|
||||
|
||||
// 3. capabilities
|
||||
final EdmTerm deleteRestrictions = edm.getTerm(new FullQualifiedName("Capabilities.DeleteRestrictions"));
|
||||
assertNotNull(deleteRestrictions);
|
||||
assertEquals(deleteRestrictions.getType().getFullQualifiedName(),
|
||||
edm.getComplexType(new FullQualifiedName("Capabilities.DeleteRestrictionsType")).getFullQualifiedName());
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ package org.apache.olingo.client.api.edm.xml.v4;
|
||||
import java.util.List;
|
||||
|
||||
public interface Annotatable {
|
||||
|
||||
|
||||
List<Annotation> getAnnotations();
|
||||
}
|
||||
|
@ -21,13 +21,11 @@ package org.apache.olingo.client.api.edm.xml.v4;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
public interface Reference {
|
||||
public interface Reference extends Annotatable {
|
||||
|
||||
URI getUri();
|
||||
|
||||
List<Include> getIncludes();
|
||||
|
||||
List<IncludeAnnotations> getIncludeAnnotations();
|
||||
|
||||
List<Annotation> getAnnotations();
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class XMLMetadataRequestImpl extends AbstractMetadataRequestImpl<List<? e
|
||||
if (!rootMetadata.getReferences().isEmpty()) {
|
||||
for (Reference reference : rootMetadata.getReferences()) {
|
||||
final SingleXMLMetadatRequestImpl includeReq = new SingleXMLMetadatRequestImpl((ODataClient) odataClient,
|
||||
odataClient.getURIBuilder(reference.getUri().toASCIIString()).appendMetadataSegment().build());
|
||||
odataClient.getURIBuilder(reference.getUri().toASCIIString()).build());
|
||||
final XMLMetadata includeMetadata = includeReq.execute().getBody();
|
||||
|
||||
for (Include include : reference.getIncludes()) {
|
||||
|
@ -26,6 +26,7 @@ import org.apache.olingo.commons.api.edm.EdmAction;
|
||||
import org.apache.olingo.commons.api.edm.EdmActionImport;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
|
||||
@ -63,6 +64,11 @@ public class EdmActionImportImpl extends EdmOperationImportImpl implements EdmAc
|
||||
return TargetType.ActionImport;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -24,6 +24,7 @@ import org.apache.olingo.client.api.edm.xml.v4.Annotatable;
|
||||
import org.apache.olingo.client.api.edm.xml.v4.Annotation;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
|
||||
public class EdmAnnotationHelperImpl implements EdmAnnotationHelper {
|
||||
@ -39,6 +40,18 @@ public class EdmAnnotationHelperImpl implements EdmAnnotationHelper {
|
||||
this.annotatable = annotatable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
EdmAnnotation result = null;
|
||||
for (EdmAnnotation annotation : getAnnotations()) {
|
||||
if (term.getFullQualifiedName().equals(annotation.getTerm().getFullQualifiedName())) {
|
||||
result = annotation;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
if (annotations == null) {
|
||||
|
@ -230,6 +230,11 @@ public class EdmAnnotationImpl implements EdmAnnotation {
|
||||
return expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -30,6 +30,7 @@ import org.apache.olingo.commons.api.edm.EdmBindingTarget;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.commons.api.edm.EdmException;
|
||||
import org.apache.olingo.commons.api.edm.EdmNavigationPropertyBinding;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.Target;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget;
|
||||
@ -101,6 +102,11 @@ public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget {
|
||||
return navigationPropertyBindings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -428,7 +428,7 @@ public class EdmClientImpl extends AbstractEdm {
|
||||
if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
|
||||
final Term term = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).getTerm(termName.getName());
|
||||
if (term != null) {
|
||||
result = new EdmTermImpl(this, term);
|
||||
result = new EdmTermImpl(this, schema.getNamespace(), term);
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,8 +455,11 @@ public class EdmClientImpl extends AbstractEdm {
|
||||
protected List<EdmAnnotation> createAnnotations(final FullQualifiedName annotatedName) {
|
||||
List<EdmAnnotation> result = null;
|
||||
|
||||
System.out.println("SSSSSSSSS1 " + annotatedName);
|
||||
|
||||
final Schema schema = xmlSchemaByNamespace.get(annotatedName.getNamespace());
|
||||
if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
|
||||
System.out.println("SSSSSSSSS2 " + ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).getAnnotatables());
|
||||
final Annotatable annotatable =
|
||||
((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).getAnnotatables().get(annotatedName.getName());
|
||||
if (annotatable != null && annotatable.getAnnotations() != null) {
|
||||
|
@ -27,6 +27,7 @@ import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmComplexType;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
@ -84,6 +85,11 @@ public class EdmComplexTypeImpl extends AbstractEdmComplexType {
|
||||
return typeHelper.isAbstract();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return annotationHelper == null ? null : annotationHelper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return annotationHelper == null ? null : annotationHelper.getAnnotations();
|
||||
|
@ -39,6 +39,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
||||
import org.apache.olingo.commons.api.edm.EdmFunctionImport;
|
||||
import org.apache.olingo.commons.api.edm.EdmSingleton;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmEntityContainer;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
@ -229,6 +230,11 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
|
||||
return TargetType.EntityContainer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper == null ? null : helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper == null ? Collections.<EdmAnnotation>emptyList() : helper.getAnnotations();
|
||||
|
@ -32,6 +32,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityType;
|
||||
import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
|
||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmEntityType;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
@ -99,6 +100,11 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
|
||||
return typeHelper.isAbstract();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return annotationHelper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return annotationHelper.getAnnotations();
|
||||
|
@ -27,6 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
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.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
|
||||
@ -75,6 +76,11 @@ public class EdmFunctionImportImpl extends EdmOperationImportImpl implements Edm
|
||||
return functionImport.isIncludeInServiceDocument();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -24,6 +24,7 @@ import org.apache.olingo.client.api.edm.xml.Member;
|
||||
import org.apache.olingo.client.core.edm.xml.v4.MemberImpl;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmMember;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
@ -39,6 +40,11 @@ public class EdmMemberImpl extends AbstractEdmMember {
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper == null ? null : helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper == null ? Collections.<EdmAnnotation>emptyList() : helper.getAnnotations();
|
||||
|
@ -26,6 +26,7 @@ import org.apache.olingo.client.api.edm.xml.v4.ReferentialConstraint;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmReferentialConstraint;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
@ -109,6 +110,11 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty {
|
||||
return structuredTypeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -26,6 +26,7 @@ import org.apache.olingo.client.api.edm.xml.v4.Action;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmParameter;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmOperation;
|
||||
@ -93,6 +94,11 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.Target;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmOperationImport;
|
||||
|
||||
@ -34,6 +35,11 @@ public abstract class EdmOperationImportImpl extends AbstractEdmOperationImport
|
||||
super(edm, container, name, entitySet == null ? null : new Target.Builder(entitySet, container).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return Collections.<EdmAnnotation>emptyList();
|
||||
|
@ -25,6 +25,7 @@ import org.apache.olingo.client.api.edm.xml.v4.Parameter;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmMapping;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.geo.SRID;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmParameter;
|
||||
@ -85,6 +86,11 @@ public class EdmParameterImpl extends AbstractEdmParameter {
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper == null ? null : helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper == null ? Collections.<EdmAnnotation>emptyList() : helper.getAnnotations();
|
||||
|
@ -26,6 +26,7 @@ import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmMapping;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.geo.SRID;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmProperty;
|
||||
@ -110,6 +111,11 @@ public class EdmPropertyImpl extends AbstractEdmProperty implements EdmProperty
|
||||
return structuredTypeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper == null ? null : helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper == null ? Collections.<EdmAnnotation>emptyList() : helper.getAnnotations();
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
import org.apache.olingo.client.api.edm.xml.v4.ReferentialConstraint;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmReferentialConstraint;
|
||||
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
|
||||
|
||||
@ -34,6 +35,11 @@ public class EdmReferentialConstraintImpl extends AbstractEdmReferentialConstrai
|
||||
this.helper = new EdmAnnotationHelperImpl(edm, constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -224,7 +224,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
|
||||
final List<Term> providerTerms = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).getTerms();
|
||||
if (providerTerms != null) {
|
||||
for (Term term : providerTerms) {
|
||||
terms.add(new EdmTermImpl(edm, term));
|
||||
terms.add(new EdmTermImpl(edm, getNamespace(), term));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,4 +260,17 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
|
||||
}
|
||||
return annotations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
EdmAnnotation result = null;
|
||||
for (EdmAnnotation annotation : getAnnotations()) {
|
||||
if (term.getFullQualifiedName().equals(annotation.getTerm().getFullQualifiedName())) {
|
||||
result = annotation;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ public class EdmTermImpl extends EdmNamedImpl implements EdmTerm {
|
||||
|
||||
private final Term term;
|
||||
|
||||
private final FullQualifiedName fqn;
|
||||
|
||||
private final EdmTypeInfo typeInfo;
|
||||
|
||||
private final EdmAnnotationHelper helper;
|
||||
@ -52,17 +54,18 @@ public class EdmTermImpl extends EdmNamedImpl implements EdmTerm {
|
||||
|
||||
private List<Class<?>> appliesTo;
|
||||
|
||||
public EdmTermImpl(final Edm edm, final Term term) {
|
||||
public EdmTermImpl(final Edm edm, final String namespace, final Term term) {
|
||||
super(edm, term.getName());
|
||||
|
||||
this.term = term;
|
||||
this.fqn = new FullQualifiedName(namespace, term.getName());
|
||||
this.typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(term.getType()).build();
|
||||
this.helper = new EdmAnnotationHelperImpl(edm, term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FullQualifiedName getFullQualifiedName() {
|
||||
return typeInfo.getFullQualifiedName();
|
||||
return fqn;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,7 +148,7 @@ public class EdmTermImpl extends EdmNamedImpl implements EdmTerm {
|
||||
|
||||
@Override
|
||||
public FullQualifiedName getAnnotationsTargetFQN() {
|
||||
return typeInfo.getFullQualifiedName();
|
||||
return getFullQualifiedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,6 +156,11 @@ public class EdmTermImpl extends EdmNamedImpl implements EdmTerm {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -25,6 +25,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmException;
|
||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
|
||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
||||
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.constants.ODataServiceVersion;
|
||||
@ -85,6 +86,11 @@ public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition implements
|
||||
return typeDefinition.isUnicode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return helper.getAnnotation(term);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return helper.getAnnotations();
|
||||
|
@ -35,6 +35,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.EdmNavigationPropertyBinding;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget;
|
||||
|
||||
@ -119,6 +120,11 @@ public class EdmEntitySetProxy extends AbstractEdmBindingTarget implements EdmEn
|
||||
return TargetType.EntitySet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return Collections.<EdmAnnotation>emptyList();
|
||||
|
@ -34,6 +34,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityType;
|
||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmReferentialConstraint;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty;
|
||||
|
||||
@ -174,6 +175,11 @@ public class EdmNavigationPropertyProxy extends AbstractEdmNavigationProperty {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return Collections.<EdmAnnotation>emptyList();
|
||||
|
@ -31,6 +31,7 @@ import org.apache.olingo.client.core.edm.EdmReturnTypeImpl;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmParameter;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmOperation;
|
||||
@ -77,6 +78,11 @@ public class EdmOperationProxy extends AbstractEdmOperation {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return Collections.<EdmAnnotation>emptyList();
|
||||
|
@ -31,6 +31,7 @@ import org.apache.olingo.client.core.edm.xml.v3.ValueTermImpl;
|
||||
import org.apache.olingo.client.core.edm.xml.v4.ActionImpl;
|
||||
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
|
||||
import org.apache.olingo.client.core.edm.xml.v4.FunctionImpl;
|
||||
import org.apache.olingo.client.core.edm.xml.v4.TermImpl;
|
||||
import org.apache.olingo.client.core.edm.xml.v4.TypeDefinitionImpl;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
|
||||
@ -112,23 +113,10 @@ public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema>
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
|
||||
setEntityContainer(entityContainer);
|
||||
}
|
||||
} else if ("Annotations".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
|
||||
((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).getAnnotationGroups().
|
||||
add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v3.AnnotationsImpl.class));
|
||||
} else {
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotationGroups().
|
||||
add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.AnnotationsImpl.class));
|
||||
}
|
||||
} else if ("Action".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getActions().
|
||||
add(jp.readValueAs(ActionImpl.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotations().
|
||||
add(jp.readValueAs(AnnotationImpl.class));
|
||||
} else if ("Function".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getFunctions().
|
||||
@ -138,6 +126,23 @@ public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema>
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
|
||||
getTypeDefinitions().add(jp.readValueAs(TypeDefinitionImpl.class));
|
||||
}
|
||||
} else if ("Annotations".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
|
||||
((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).getAnnotationGroups().
|
||||
add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v3.AnnotationsImpl.class));
|
||||
} else {
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotationGroups().
|
||||
add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.AnnotationsImpl.class));
|
||||
}
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotations().
|
||||
add(jp.readValueAs(AnnotationImpl.class));
|
||||
} else if ("Term".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getTerms().
|
||||
add(jp.readValueAs(TermImpl.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,14 +24,12 @@ import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.olingo.client.api.edm.xml.v4.Annotation;
|
||||
import org.apache.olingo.client.api.edm.xml.v4.Include;
|
||||
import org.apache.olingo.client.api.edm.xml.v4.IncludeAnnotations;
|
||||
import org.apache.olingo.client.api.edm.xml.v4.Reference;
|
||||
import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
|
||||
|
||||
@JsonDeserialize(using = ReferenceDeserializer.class)
|
||||
public class ReferenceImpl extends AbstractEdmItem implements Reference {
|
||||
public class ReferenceImpl extends AbstractAnnotatable implements Reference {
|
||||
|
||||
private static final long serialVersionUID = -5600031479702563436L;
|
||||
|
||||
@ -41,8 +39,6 @@ public class ReferenceImpl extends AbstractEdmItem implements Reference {
|
||||
|
||||
private final List<IncludeAnnotations> includeAnnotations = new ArrayList<IncludeAnnotations>();
|
||||
|
||||
private final List<Annotation> annotations = new ArrayList<Annotation>();
|
||||
|
||||
@Override
|
||||
public URI getUri() {
|
||||
return uri;
|
||||
@ -62,9 +58,4 @@ public class ReferenceImpl extends AbstractEdmItem implements Reference {
|
||||
return includeAnnotations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Annotation> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -202,7 +202,6 @@ public class SchemaImpl extends AbstractSchema implements Schema {
|
||||
for (ComplexType complexType : getComplexTypes()) {
|
||||
annotatables.put(complexType.getName(), complexType);
|
||||
}
|
||||
annotatables.put(entityContainer.getName(), entityContainer);
|
||||
for (EntityType entityType : getEntityTypes()) {
|
||||
annotatables.put(entityType.getName(), entityType);
|
||||
}
|
||||
@ -218,6 +217,9 @@ public class SchemaImpl extends AbstractSchema implements Schema {
|
||||
for (TypeDefinition typedef : getTypeDefinitions()) {
|
||||
annotatables.put(typedef.getName(), typedef);
|
||||
}
|
||||
if (entityContainer != null) {
|
||||
annotatables.put(entityContainer.getName(), entityContainer);
|
||||
}
|
||||
}
|
||||
return annotatables;
|
||||
}
|
||||
|
@ -25,5 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface EdmAnnotatable {
|
||||
|
||||
EdmAnnotation getAnnotation(EdmTerm term);
|
||||
|
||||
List<EdmAnnotation> getAnnotations();
|
||||
}
|
||||
|
@ -177,6 +177,12 @@ public abstract class AbstractEdm implements Edm {
|
||||
EdmSchema schema = null;
|
||||
if (schemas != null) {
|
||||
schema = schemas.get(namespace);
|
||||
if (schema == null) {
|
||||
if (aliasToNamespaceInfo == null) {
|
||||
aliasToNamespaceInfo = createAliasToNamespaceInfo();
|
||||
}
|
||||
schema = schemas.get(aliasToNamespaceInfo.get(namespace));
|
||||
}
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public abstract class AbstractEdmSchema implements EdmSchema {
|
||||
|
||||
private EdmEntityContainer entityContainer;
|
||||
|
||||
public AbstractEdmSchema(String namespace, String alias) {
|
||||
public AbstractEdmSchema(final String namespace, final String alias) {
|
||||
this.namespace = namespace;
|
||||
this.alias = alias;
|
||||
}
|
||||
|
@ -18,10 +18,7 @@
|
||||
*/
|
||||
package org.apache.olingo.commons.core.edm;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotatable;
|
||||
|
||||
public interface EdmAnnotationHelper {
|
||||
|
||||
List<EdmAnnotation> getAnnotations();
|
||||
public interface EdmAnnotationHelper extends EdmAnnotatable {
|
||||
}
|
||||
|
@ -22,12 +22,25 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotatable;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
|
||||
public abstract class AbstractEdmAnnotatableDynamicAnnotationExpression
|
||||
extends AbstractEdmDynamicAnnotationExpression implements EdmAnnotatable {
|
||||
|
||||
private final List<EdmAnnotation> annotations = new ArrayList<EdmAnnotation>();
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
EdmAnnotation result = null;
|
||||
for (EdmAnnotation annotation : getAnnotations()) {
|
||||
if (term.getFullQualifiedName().equals(annotation.getTerm().getFullQualifiedName())) {
|
||||
result = annotation;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
return annotations;
|
||||
|
@ -25,6 +25,7 @@ import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmComplexType;
|
||||
import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
|
||||
@ -66,6 +67,12 @@ public class EdmComplexTypeImpl extends AbstractEdmComplexType {
|
||||
return helper.isAbstract();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -28,6 +28,7 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
||||
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.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmEntityContainer;
|
||||
import org.apache.olingo.server.api.edm.provider.ActionImport;
|
||||
@ -194,7 +195,13 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -23,6 +23,7 @@ import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntitySet;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.server.api.edm.provider.EntitySet;
|
||||
|
||||
public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntitySet {
|
||||
@ -43,7 +44,13 @@ public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntityS
|
||||
public TargetType getAnnotationsTargetType() {
|
||||
return TargetType.EntitySet;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -28,6 +28,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityType;
|
||||
import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
|
||||
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmEntityType;
|
||||
import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
|
||||
@ -99,6 +100,12 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
|
||||
return helper.isAbstract();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -21,6 +21,7 @@ package org.apache.olingo.server.core.edm.provider;
|
||||
import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmMember;
|
||||
|
||||
@ -30,6 +31,12 @@ public class EdmMemberImpl extends AbstractEdmMember {
|
||||
super(edm, enumFQN, name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -24,6 +24,7 @@ import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmReferentialConstraint;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty;
|
||||
import org.apache.olingo.server.api.edm.provider.NavigationProperty;
|
||||
@ -104,6 +105,12 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty {
|
||||
return structuredTypeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -24,6 +24,7 @@ import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmParameter;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmOperation;
|
||||
@ -84,6 +85,12 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmOperationImport;
|
||||
import org.apache.olingo.server.api.edm.provider.OperationImport;
|
||||
|
||||
@ -32,6 +33,12 @@ public abstract class EdmOperationImportImpl extends AbstractEdmOperationImport
|
||||
super(edm, container, operationImport.getName(), operationImport.getEntitySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmMapping;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.geo.SRID;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmParameter;
|
||||
import org.apache.olingo.server.api.edm.provider.Parameter;
|
||||
@ -70,6 +71,12 @@ public class EdmParameterImpl extends AbstractEdmParameter {
|
||||
return null; // TODO: provide implementation
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -23,6 +23,7 @@ import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmMapping;
|
||||
import org.apache.olingo.commons.api.edm.EdmProperty;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.geo.SRID;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmProperty;
|
||||
@ -105,6 +106,12 @@ public class EdmPropertyImpl extends AbstractEdmProperty implements EdmProperty
|
||||
return structuredTypeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -20,6 +20,7 @@ package org.apache.olingo.server.core.edm.provider;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.commons.core.edm.AbstractEdmReferentialConstraint;
|
||||
|
||||
public class EdmReferentialConstraintImpl extends AbstractEdmReferentialConstraint {
|
||||
@ -28,6 +29,12 @@ public class EdmReferentialConstraintImpl extends AbstractEdmReferentialConstrai
|
||||
super(property, referencedProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -160,6 +160,12 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -23,6 +23,7 @@ import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.commons.api.edm.EdmSingleton;
|
||||
import org.apache.olingo.commons.api.edm.EdmTerm;
|
||||
import org.apache.olingo.server.api.edm.provider.Singleton;
|
||||
|
||||
public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSingleton {
|
||||
@ -35,7 +36,13 @@ public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSinglet
|
||||
public TargetType getAnnotationsTargetType() {
|
||||
return TargetType.Singleton;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
@ -24,6 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.EdmException;
|
||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
|
||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
||||
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.geo.SRID;
|
||||
@ -82,6 +83,12 @@ public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition implements
|
||||
return typeDefinition.getIsUnicode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdmAnnotation getAnnotation(final EdmTerm term) {
|
||||
// TODO: implement
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdmAnnotation> getAnnotations() {
|
||||
// TODO: implement
|
||||
|
Loading…
x
Reference in New Issue
Block a user