Repository: olingo-odata2
Updated Branches:
  refs/heads/clientModule 91bd4b897 -> 9e949e406


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-client-core/src/test/resources/feed_with_deleted_entries.xml
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-client-core/src/test/resources/feed_with_deleted_entries.xml 
b/odata2-lib/odata-client-core/src/test/resources/feed_with_deleted_entries.xml
new file mode 100644
index 0000000..78c187e
--- /dev/null
+++ 
b/odata2-lib/odata-client-core/src/test/resources/feed_with_deleted_entries.xml
@@ -0,0 +1,40 @@
+<?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. -->
+<feed xmlns="http://www.w3.org/2005/Atom"; 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
+    xmlns:at="http://purl.org/atompub/tombstones/1.0"; 
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices";
+    
xml:base="https://olingoodata.neo.ondemand.com:443/com.sap.olingo.web/ReferenceScenario.svc/";>
+    
<id>https://olingoodata.neo.ondemand.com:443/com.sap.olingo.web/ReferenceScenario.svc/Rooms</id>
+    <title type="text">Rooms</title>
+    <updated>2014-01-21T09:15:52.473Z</updated>
+    <author>
+        <name />
+    </author>
+    <link href="Rooms" rel="self" title="Rooms" />
+    <entry m:etag="W/&quot;1&quot;">
+        <id>http://host:123/odata/Rooms('1')</id>
+        <title type="text">Room 1</title>
+        <updated>2014-01-21T09:15:52.474Z</updated>
+        <category term="RefScenario.Room" 
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"; />
+        <link href="Rooms('1')" rel="edit" title="Room" />
+        <link href="Rooms('1')/nr_Employees" 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Employees";
+            title="nr_Employees" type="application/atom+xml;type=feed" />
+        <link href="Rooms('1')/nr_Building" 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Building";
+            title="nr_Building" type="application/atom+xml;type=entry" />
+        <content type="application/xml">
+            <m:properties>
+                <d:Id>1</d:Id>
+                <d:Name>Room 1</d:Name>
+                <d:Seats>1</d:Seats>
+                <d:Version>1</d:Version>
+            </m:properties>
+        </content>
+    </entry>
+    <at:deleted-entry ref="http://host:123/odata/Rooms('2')" 
when="2014-01-14T18:11:06.682+01:00" />
+    <link href="http://host:123/odata/Rooms?$skiptoken=97"; rel="delta" />
+</feed>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-client-core/src/test/resources/feed_with_delta_link.xml
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-client-core/src/test/resources/feed_with_delta_link.xml 
b/odata2-lib/odata-client-core/src/test/resources/feed_with_delta_link.xml
new file mode 100644
index 0000000..bb73341
--- /dev/null
+++ b/odata2-lib/odata-client-core/src/test/resources/feed_with_delta_link.xml
@@ -0,0 +1,69 @@
+<?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.
+-->
+<feed xmlns="http://www.w3.org/2005/Atom";
+       xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
+       xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices";
+       xmlns:at="http://purl.org/atompub/tombstones/1.0";
+       xml:base="http://some.host.com/service.root/ReferenceScenario.svc/";>
+       
<id>http://some.host.com/service.root/ReferenceScenario.svc/Employees</id>
+       <title type="text">Employees</title>
+       <updated>2013-04-23T11:46:14.926Z</updated>
+       <author>
+               <name />
+       </author>
+       <link href="Employees" rel="self" title="Employees" />
+       <entry>
+               
<id>http://some.host.com/service.root/ReferenceScenario.svc/Employees('1')</id>
+               <title type="text">Walter Winter</title>
+               <updated>1999-01-01T00:00:00Z</updated>
+               <category term="RefScenario.Employee"
+                       
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"; />
+               <link href="Employees('1')" rel="edit" title="Employee" />
+               <link href="Employees('1')/$value" rel="edit-media" 
type="application/octet-stream" />
+               <link href="Employees('1')/ne_Manager"
+                       
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ne_Manager";
+                       title="ne_Manager" type="application/atom+xml; 
type=entry" />
+               <link href="Employees('1')/ne_Team"
+                       
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ne_Team";
+                       title="ne_Team" type="application/atom+xml; type=entry" 
/>
+               <link href="Employees('1')/ne_Room"
+                       
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ne_Room";
+                       title="ne_Room" type="application/atom+xml; type=entry" 
/>
+               <content type="application/octet-stream" 
src="Employees('1')/$value" />
+               <m:properties>
+                       <d:EmployeeId>1</d:EmployeeId>
+                       <d:EmployeeName>Walter Winter</d:EmployeeName>
+                       <d:ManagerId>1</d:ManagerId>
+                       <d:RoomId>1</d:RoomId>
+                       <d:TeamId>1</d:TeamId>
+                       <d:Location m:type="RefScenario.c_Location">
+                               <d:City m:type="RefScenario.c_City">
+                                       <d:PostalCode>69124</d:PostalCode>
+                                       <d:CityName>Heidelberg</d:CityName>
+                               </d:City>
+                               <d:Country>Germany</d:Country>
+                       </d:Location>
+                       <d:Age>52</d:Age>
+                       <d:EntryDate>1999-01-01T00:00:00</d:EntryDate>
+                       <d:ImageUrl>Employees('1')/$value</d:ImageUrl>
+               </m:properties>
+       </entry>
+       <link href="http://thisisadeltalink"; rel="delta"/>
+</feed>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-client-core/src/test/resources/metadataForDeepInsert.xml
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-client-core/src/test/resources/metadataForDeepInsert.xml 
b/odata2-lib/odata-client-core/src/test/resources/metadataForDeepInsert.xml
new file mode 100644
index 0000000..a718bf5
--- /dev/null
+++ b/odata2-lib/odata-client-core/src/test/resources/metadataForDeepInsert.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edmx:Edmx Version="1.0" 
xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"; 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; >
+       <edmx:DataServices m:DataServiceVersion="2.0">
+               <Schema Namespace="API_PRODUCT_SRV" xml:lang="en"  
xmlns="http://schemas.microsoft.com/ado/2008/09/edm";>
+                       <EntityType Name="A_ProductType" >
+                               <Key>
+                                       <PropertyRef Name="Product"/>
+                               </Key>
+                               <Property Name="Product" Type="Edm.String" 
Nullable="false" MaxLength="40" />
+                               <Property Name="BaseUnit" Type="Edm.String" 
MaxLength="3" />
+                               <Property Name="ProductType" Type="Edm.String" 
MaxLength="4"/>
+                               <NavigationProperty Name="to_Description" 
Relationship="API_PRODUCT_SRV.assoc_B3BC21CD74485D381C22EBC58AD5D2F4" 
FromRole="FromRole_assoc_B3BC21CD74485D381C22EBC58AD5D2F4" 
ToRole="ToRole_assoc_B3BC21CD74485D381C22EBC58AD5D2F4"/>
+                               </EntityType>
+                       <EntityType Name="A_ProductDescriptionType" >
+                               <Key>
+                                       <PropertyRef Name="Product"/>
+                                       <PropertyRef Name="Language"/>
+                               </Key>
+                               <Property Name="Product" Type="Edm.String" 
Nullable="false" MaxLength="40" />
+                               <Property Name="Language" Type="Edm.String" 
Nullable="false" MaxLength="2" />
+                               <Property Name="ProductDescription" 
Type="Edm.String" MaxLength="40" />
+                       </EntityType>
+                       <Association 
Name="assoc_2754A00DBA9C146B098B85A076E625EE" >
+                               <End Type="API_PRODUCT_SRV.A_ProductPlantType" 
Multiplicity="1" Role="FromRole_assoc_2754A00DBA9C146B098B85A076E625EE"/>
+                               <End 
Type="API_PRODUCT_SRV.A_ProductStorageLocationType" Multiplicity="*" 
Role="ToRole_assoc_2754A00DBA9C146B098B85A076E625EE"/>
+                       </Association>
+                       <Association 
Name="assoc_9E0A9389B585D61EBCFB6C47D388CE0D" >
+                               <End Type="API_PRODUCT_SRV.A_ProductType" 
Multiplicity="1" Role="FromRole_assoc_9E0A9389B585D61EBCFB6C47D388CE0D"/>
+                               <End Type="API_PRODUCT_SRV.A_ProductPlantType" 
Multiplicity="*" Role="ToRole_assoc_9E0A9389B585D61EBCFB6C47D388CE0D"/>
+                       </Association>
+                       <Association 
Name="assoc_0D511862D40D30AD11CA2FE43EBDB1DD" >
+                               <End Type="API_PRODUCT_SRV.A_ProductType" 
Multiplicity="1" Role="FromRole_assoc_0D511862D40D30AD11CA2FE43EBDB1DD"/>
+                               <End 
Type="API_PRODUCT_SRV.A_ProductSalesTaxType" Multiplicity="*" 
Role="ToRole_assoc_0D511862D40D30AD11CA2FE43EBDB1DD"/>
+                       </Association>
+                       <Association 
Name="assoc_4AFBA201432776E45B5D3FB9FF74534E" >
+                               <End Type="API_PRODUCT_SRV.A_ProductType" 
Multiplicity="1" Role="FromRole_assoc_4AFBA201432776E45B5D3FB9FF74534E"/>
+                               <End 
Type="API_PRODUCT_SRV.A_ProductSalesDeliveryType" Multiplicity="*" 
Role="ToRole_assoc_4AFBA201432776E45B5D3FB9FF74534E"/>
+                       </Association>
+                       <Association 
Name="assoc_B3BC21CD74485D381C22EBC58AD5D2F4" >
+                               <End Type="API_PRODUCT_SRV.A_ProductType" 
Multiplicity="1" Role="FromRole_assoc_B3BC21CD74485D381C22EBC58AD5D2F4"/>
+                               <End 
Type="API_PRODUCT_SRV.A_ProductDescriptionType" Multiplicity="*" 
Role="ToRole_assoc_B3BC21CD74485D381C22EBC58AD5D2F4"/>
+                       </Association>
+                       <EntityContainer Name="API_PRODUCT_SRV_Entities" 
m:IsDefaultEntityContainer="true" >
+                               <EntitySet Name="A_Product" 
EntityType="API_PRODUCT_SRV.A_ProductType" />
+                               <EntitySet Name="A_ProductDescription" 
EntityType="API_PRODUCT_SRV.A_ProductDescriptionType" />
+                               <AssociationSet 
Name="assoc_B3BC21CD74485D381C22EBC58AD5D2F4" 
Association="API_PRODUCT_SRV.assoc_B3BC21CD74485D381C22EBC58AD5D2F4" >
+                                       <End EntitySet="A_Product" 
Role="FromRole_assoc_B3BC21CD74485D381C22EBC58AD5D2F4"/>
+                                       <End EntitySet="A_ProductDescription" 
Role="ToRole_assoc_B3BC21CD74485D381C22EBC58AD5D2F4"/>
+                               </AssociationSet>
+                       </EntityContainer>
+               </Schema>
+       </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-client-core/src/test/resources/metadataForRelatedEntity.xml
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-client-core/src/test/resources/metadataForRelatedEntity.xml 
b/odata2-lib/odata-client-core/src/test/resources/metadataForRelatedEntity.xml
new file mode 100644
index 0000000..2a5ee89
--- /dev/null
+++ 
b/odata2-lib/odata-client-core/src/test/resources/metadataForRelatedEntity.xml
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<edmx:Edmx Version="1.0" 
xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"; 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; 
xmlns:sap="http://www.sap.com/Protocols/SAPData";>
+       <edmx:DataServices m:DataServiceVersion="2.0">
+               <Schema Namespace="CUAN_BUSINESS_DOCUMENT_IMP_SRV" 
xml:lang="en" sap:schema-version="1" 
xmlns="http://schemas.microsoft.com/ado/2008/09/edm";>
+                       <EntityType Name="ImportHeader" sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="Id"/>
+                               </Key>
+                               <Property Name="Id" Type="Edm.String" 
Nullable="false" MaxLength="32" sap:label="ID" sap:updatable="false"/>
+                               <Property Name="Timestamp" Type="Edm.DateTime" 
Precision="7" sap:label="Timestamp" sap:updatable="false"/>
+                               <Property Name="SourceSystemType" 
Type="Edm.String" MaxLength="20" sap:label="Source System Type" 
sap:updatable="false"/>
+                               <Property Name="SourceSystemId" 
Type="Edm.String" MaxLength="20" sap:label="Source System ID" 
sap:updatable="false"/>
+                               <NavigationProperty Name="BusinessDocuments" 
Relationship="CUAN_BUSINESS_DOCUMENT_IMP_SRV.HeaderBusinessDocument" 
FromRole="FromRole_HeaderBusinessDocument" 
ToRole="ToRole_HeaderBusinessDocument" sap:label="Business Documents"/>
+                       </EntityType>
+                       <EntityType Name="BusinessDocument" 
sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="Id"/>
+                               </Key>
+                               <Property Name="Id" Type="Edm.String" 
Nullable="false" MaxLength="32" sap:label="Key" sap:updatable="false"/>
+                               <Property Name="ContactIdOrigin" 
Type="Edm.String" MaxLength="20" sap:label="Contact ID Origin" 
sap:updatable="false"/>
+                               <Property Name="ContactId" Type="Edm.String" 
MaxLength="255" sap:label="Contact ID" sap:updatable="false"/>
+                               <Property Name="InternalContactId" 
Type="Edm.String" MaxLength="255" sap:label="Internal Contact ID" 
sap:updatable="false"/>
+                               <Property Name="InternalObjectType" 
Type="Edm.String" MaxLength="20" sap:label="Business Document Type" 
sap:updatable="false"/>
+                               <Property Name="ExternalObjectType" 
Type="Edm.String" MaxLength="30" sap:label="Internal Object Type" 
sap:updatable="false"/>
+                               <Property Name="ExternalId" Type="Edm.String" 
MaxLength="50" sap:label="External Id" sap:updatable="false"/>
+                               <Property Name="ExternalStatusCode" 
Type="Edm.String" MaxLength="2" sap:label="Status Code" sap:updatable="false"/>
+                               <Property Name="ExternalTimeStamp" 
Type="Edm.DateTime" Precision="7" sap:label="External Time Stamp" 
sap:updatable="false"/>
+                               <Property Name="Content" Type="Edm.String" 
sap:label="Business Document Content" sap:updatable="false" 
sap:sortable="false"/>
+                               <Property Name="ExpectedRevenue" 
Type="Edm.Decimal" Precision="31" Scale="2" sap:unit="Currency" 
sap:label="Expected Revenue" sap:updatable="false"/>
+                               <Property Name="Currency" Type="Edm.String" 
MaxLength="5" sap:label="Currency" sap:updatable="false" 
sap:semantics="currency-code"/>
+                               <Property Name="PredecessorId" 
Type="Edm.String" MaxLength="50" sap:label="Predecessor Id" 
sap:updatable="false"/>
+                               <Property Name="ActionCode" Type="Edm.String" 
MaxLength="2" sap:label="Action Code" sap:updatable="false"/>
+                               <Property Name="ContentTitle" Type="Edm.String" 
MaxLength="255" sap:label="Content Title" sap:updatable="false"/>
+                               <Property Name="EndTimeStamp" 
Type="Edm.DateTime" Precision="7" sap:label="End Timestamp" 
sap:updatable="false"/>
+                               <Property Name="Reason" Type="Edm.String" 
MaxLength="20" sap:label="Reason" sap:updatable="false"/>
+                               <Property Name="ExternalAdditionalId" 
Type="Edm.String" MaxLength="50" sap:label="External Additional ID" 
sap:updatable="false"/>
+                               <Property Name="Amount" Type="Edm.Decimal" 
Precision="31" Scale="2" sap:unit="Currency" sap:label="Expected Revenue" 
sap:updatable="false"/>
+                               <Property Name="Boolean1" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Boolean2" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Boolean3" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Boolean4" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Date3" Type="Edm.DateTime" 
Precision="0" sap:display-format="Date" sap:label="Date" 
sap:is-extension-field="true"/>
+                               <Property Name="Number1" Type="Edm.Int32" 
sap:label="INT4" sap:is-extension-field="true"/>
+                               <Property Name="Number2" Type="Edm.Int32" 
sap:label="INT4" sap:is-extension-field="true"/>
+                               <Property Name="Text201" Type="Edm.String" 
MaxLength="20" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text202" Type="Edm.String" 
MaxLength="20" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Decimal1" Type="Edm.Decimal" 
Precision="25" Scale="2" sap:label="Decimal Value" 
sap:is-extension-field="true"/>
+                               <Property Name="Text401" Type="Edm.String" 
MaxLength="40" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text402" Type="Edm.String" 
MaxLength="40" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text801" Type="Edm.String" 
MaxLength="80" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text802" Type="Edm.String" 
MaxLength="80" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text1201" Type="Edm.String" 
MaxLength="120" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text1202" Type="Edm.String" 
MaxLength="120" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text2551" Type="Edm.String" 
MaxLength="255" sap:label="Text" sap:is-extension-field="true"/>
+                               <NavigationProperty Name="ProductItems" 
Relationship="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentProductItem" 
FromRole="FromRole_BusinessDocumentProductItem" 
ToRole="ToRole_BusinessDocumentProductItem"/>
+                               <NavigationProperty Name="Offers" 
Relationship="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentOffer" 
FromRole="FromRole_BusinessDocumentOffer" ToRole="ToRole_BusinessDocumentOffer" 
sap:label="Offers"/>
+                               <NavigationProperty 
Name="AdditionalObjectReferences" 
Relationship="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentAdditionalObjectRef"
 FromRole="FromRole_BusinessDocumentAdditionalObjectRef" 
ToRole="ToRole_BusinessDocumentAdditionalObjectRef" sap:label="Additional 
Object References"/>
+                               <NavigationProperty Name="Person" 
Relationship="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentPerson" 
FromRole="FromRole_BusinessDocumentPerson" 
ToRole="ToRole_BusinessDocumentPerson"/>
+                               <NavigationProperty Name="Company" 
Relationship="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentCompany" 
FromRole="FromRole_BusinessDocumentCompany" 
ToRole="ToRole_BusinessDocumentCompany"/>
+                       </EntityType>
+                       <EntityType Name="Company" sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="Id"/>
+                                       <PropertyRef Name="IdOrigin"/>
+                               </Key>
+                               <Property Name="Id" Type="Edm.String" 
Nullable="false" MaxLength="100" sap:label="Company ID"/>
+                               <Property Name="IdOrigin" Type="Edm.String" 
Nullable="false" MaxLength="20" sap:label="Company ID Origin"/>
+                               <Property Name="InternalId" Type="Edm.String" 
Nullable="false" MaxLength="100" sap:label="yMKT Company ID"/>
+                               <Property Name="LastChangeDate" 
Type="Edm.DateTime" Nullable="false" Precision="7" sap:label="Last Change 
Date"/>
+                               <Property Name="CompanyName" Type="Edm.String" 
MaxLength="80" sap:label="Name"/>
+                               <Property Name="CountryCode" Type="Edm.String" 
MaxLength="3" sap:label="Country Code"/>
+                               <Property Name="RegionCode" Type="Edm.String" 
MaxLength="3" sap:label="Region Code"/>
+                               <Property Name="CityName" Type="Edm.String" 
MaxLength="40" sap:label="City Name"/>
+                               <Property Name="PostalCode" Type="Edm.String" 
MaxLength="10" sap:label="Postal Code"/>
+                               <Property Name="Street" Type="Edm.String" 
MaxLength="60" sap:label="Street"/>
+                               <Property Name="HouseNumber" Type="Edm.String" 
MaxLength="10" sap:label="House Number"/>
+                               <Property Name="EmailAddress" Type="Edm.String" 
MaxLength="241" sap:label="Email Address"/>
+                               <Property Name="PhoneNumber" Type="Edm.String" 
MaxLength="30" sap:label="Phone Number"/>
+                               <Property Name="FaxNumber" Type="Edm.String" 
MaxLength="30" sap:label="Fax Number"/>
+                               <Property Name="WebSite" Type="Edm.String" 
MaxLength="1000" sap:label="Web URI"/>
+                               <Property Name="IndustryCode" Type="Edm.String" 
MaxLength="4" sap:label="Industry Code"/>
+                               <Property Name="LanguageCode" Type="Edm.String" 
MaxLength="2" sap:label="Preferred Language Code"/>
+                               <Property Name="Date2" Type="Edm.DateTime" 
Precision="0" sap:display-format="Date" sap:label="Date" 
sap:is-extension-field="true"/>
+                               <Property Name="Date3" Type="Edm.DateTime" 
Precision="0" sap:display-format="Date" sap:label="Date" 
sap:is-extension-field="true"/>
+                               <Property Name="Number3" Type="Edm.Int32" 
sap:label="INT4" sap:is-extension-field="true"/>
+                               <Property Name="Text202" Type="Edm.String" 
MaxLength="20" sap:label="Description" sap:is-extension-field="true"/>
+                               <Property Name="Text402" Type="Edm.String" 
MaxLength="40" sap:label="Text, 40 Characters Long" 
sap:is-extension-field="true"/>
+                               <Property Name="Text1201" Type="Edm.String" 
MaxLength="120" sap:label="Text (Length 120)" sap:is-extension-field="true"/>
+                       </EntityType>
+                       <EntityType Name="Person" sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="Id"/>
+                                       <PropertyRef Name="IdOrigin"/>
+                               </Key>
+                               <Property Name="Id" Type="Edm.String" 
Nullable="false" MaxLength="100" sap:label="Company ID"/>
+                               <Property Name="IdOrigin" Type="Edm.String" 
Nullable="false" MaxLength="20" sap:label="Company ID Origin"/>
+                               <Property Name="InternalId" Type="Edm.String" 
Nullable="false" MaxLength="100" sap:label="Internal Company Id"/>
+                               <Property Name="LastChangeDate" 
Type="Edm.DateTime" Nullable="false" Precision="7" sap:label="Last Change 
Date"/>
+                               <Property Name="FirstName" Type="Edm.String" 
MaxLength="40" sap:label="First Name"/>
+                               <Property Name="LastName" Type="Edm.String" 
MaxLength="40" sap:label="Last Name"/>
+                               <Property Name="FullName" Type="Edm.String" 
MaxLength="80" sap:label="Full Name"/>
+                               <Property Name="DateOfBirth" 
Type="Edm.DateTime" Precision="0" sap:display-format="Date" sap:label="Date of 
Birth"/>
+                               <Property Name="GenderCode" Type="Edm.String" 
MaxLength="1" sap:label="Gender Code"/>
+                               <Property Name="MaritalStatusCode" 
Type="Edm.String" MaxLength="1" sap:label="Marital Status Code"/>
+                               <Property Name="TitleCode" Type="Edm.String" 
MaxLength="4" sap:label="Title Code"/>
+                               <Property Name="CountryCode" Type="Edm.String" 
MaxLength="3" sap:label="Country Code"/>
+                               <Property Name="RegionCode" Type="Edm.String" 
MaxLength="3" sap:label="Region Code"/>
+                               <Property Name="CityName" Type="Edm.String" 
MaxLength="40" sap:label="City Name"/>
+                               <Property Name="PostalCode" Type="Edm.String" 
MaxLength="10" sap:label="Postal Code"/>
+                               <Property Name="Street" Type="Edm.String" 
MaxLength="60" sap:label="Street"/>
+                               <Property Name="HouseNumber" Type="Edm.String" 
MaxLength="10" sap:label="House Number"/>
+                               <Property Name="EmailAddress" Type="Edm.String" 
MaxLength="241" sap:label="Email Address"/>
+                               <Property Name="PhoneNumber" Type="Edm.String" 
MaxLength="30" sap:label="Phone Number"/>
+                               <Property Name="MobilePhoneNumber" 
Type="Edm.String" MaxLength="30" sap:label="Mobile Phone Number"/>
+                               <Property Name="FaxNumber" Type="Edm.String" 
MaxLength="30" sap:label="Fax Number"/>
+                               <Property Name="WebSite" Type="Edm.String" 
MaxLength="1000" sap:label="Web URI"/>
+                               <Property Name="IsConsumer" Type="Edm.Boolean" 
sap:label="Person is Consumer"/>
+                               <Property Name="IsContact" Type="Edm.Boolean" 
sap:label="Person is Contact"/>
+                               <Property Name="LanguageCode" Type="Edm.String" 
MaxLength="2" sap:label="Preferred Language"/>
+                               <Property Name="Boolean1" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Boolean2" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Boolean3" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Boolean4" Type="Edm.Boolean" 
sap:label="TRUE" sap:is-extension-field="true"/>
+                               <Property Name="Time1" Type="Edm.Time" 
Precision="0" sap:label="Field of type TIMS" sap:is-extension-field="true"/>
+                               <Property Name="Date1" Type="Edm.DateTime" 
Precision="0" sap:display-format="Date" sap:label="Date" 
sap:is-extension-field="true"/>
+                               <Property Name="Number1" Type="Edm.Int32" 
sap:label="INT4" sap:is-extension-field="true"/>
+                               <Property Name="Number2" Type="Edm.Int32" 
sap:label="INT4" sap:is-extension-field="true"/>
+                               <Property Name="Text201" Type="Edm.String" 
MaxLength="20" sap:label="Description" sap:is-extension-field="true"/>
+                               <Property Name="Text203" Type="Edm.String" 
MaxLength="20" sap:label="Description" sap:is-extension-field="true"/>
+                               <Property Name="Timestamp1" Type="Edm.DateTime" 
Precision="7" sap:label="Time Stamp" sap:is-extension-field="true"/>
+                               <Property Name="Timestamp2" Type="Edm.DateTime" 
Precision="7" sap:label="Time Stamp" sap:is-extension-field="true"/>
+                               <Property Name="Decimal1" Type="Edm.Decimal" 
Precision="25" Scale="2" sap:label="Decimal Value" 
sap:is-extension-field="true"/>
+                               <Property Name="Decimal2" Type="Edm.Decimal" 
Precision="25" Scale="2" sap:label="Decimal Value" 
sap:is-extension-field="true"/>
+                               <Property Name="Decimal3" Type="Edm.Decimal" 
Precision="25" Scale="2" sap:label="Decimal Value" 
sap:is-extension-field="true"/>
+                               <Property Name="Text401" Type="Edm.String" 
MaxLength="40" sap:label="Text, 40 Characters Long" 
sap:is-extension-field="true"/>
+                               <Property Name="Text403" Type="Edm.String" 
MaxLength="40" sap:label="Text, 40 Characters Long" 
sap:is-extension-field="true"/>
+                               <Property Name="Text801" Type="Edm.String" 
MaxLength="80" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text802" Type="Edm.String" 
MaxLength="80" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text803" Type="Edm.String" 
MaxLength="80" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text1202" Type="Edm.String" 
MaxLength="120" sap:label="Text (Length 120)" sap:is-extension-field="true"/>
+                               <Property Name="Text1203" Type="Edm.String" 
MaxLength="120" sap:label="Text (Length 120)" sap:is-extension-field="true"/>
+                               <Property Name="Text2551" Type="Edm.String" 
MaxLength="255" sap:label="Text" sap:is-extension-field="true"/>
+                               <Property Name="Text2552" Type="Edm.String" 
MaxLength="255" sap:label="Text" sap:is-extension-field="true"/>
+                       </EntityType>
+                       <EntityType Name="ProductItem" sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="Id"/>
+                                       <PropertyRef Name="ObjectType"/>
+                               </Key>
+                               <Property Name="Id" Type="Edm.String" 
Nullable="false" MaxLength="32" sap:label="ID" sap:updatable="false"/>
+                               <Property Name="ObjectType" Type="Edm.String" 
Nullable="false" MaxLength="30" sap:label="Origin of Product" 
sap:updatable="false"/>
+                               <Property Name="ObjectId" Type="Edm.String" 
Nullable="false" MaxLength="50" sap:label="Product ID" sap:updatable="false"/>
+                               <Property Name="ProductName" Type="Edm.String" 
MaxLength="40" sap:label="Product" sap:updatable="false"/>
+                               <Property Name="ProductDesc" Type="Edm.String" 
MaxLength="512" sap:label="Product Desc." sap:updatable="false"/>
+                               <Property Name="Amount" Type="Edm.Decimal" 
Precision="31" Scale="2" sap:label="Amount" sap:updatable="false"/>
+                               <Property Name="Quantity" Type="Edm.Decimal" 
Precision="22" Scale="5" sap:unit="UnitOfMeasure" sap:label="Quantity" 
sap:updatable="false"/>
+                               <Property Name="UnitOfMeasure" 
Type="Edm.String" MaxLength="3" sap:label="Unit of Measure" 
sap:updatable="false"/>
+                               <Property Name="Boolean1" Type="Edm.Boolean" 
sap:label="Boolean" sap:is-extension-field="true"/>
+                               <Property Name="Amount1" Type="Edm.Decimal" 
Precision="31" Scale="2" sap:unit="PC41DED6CC4BCDED781F75143862C189C" 
sap:label="Amount" sap:is-extension-field="true"/>
+                       </EntityType>
+                       <EntityType Name="AdditionalObjectReference" 
sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="ObjectType"/>
+                                       <PropertyRef Name="ObjectId"/>
+                               </Key>
+                               <Property Name="ObjectType" Type="Edm.String" 
Nullable="false" MaxLength="30" sap:label="Object Type" sap:updatable="false"/>
+                               <Property Name="ObjectId" Type="Edm.String" 
Nullable="false" MaxLength="50" sap:label="Object ID" sap:updatable="false"/>
+                       </EntityType>
+                       <EntityType Name="Offer" sap:content-version="1">
+                               <Key>
+                                       <PropertyRef Name="Origin"/>
+                                       <PropertyRef Name="Id"/>
+                               </Key>
+                               <Property Name="Origin" Type="Edm.String" 
Nullable="false" MaxLength="30" sap:label="Origin" sap:updatable="false"/>
+                               <Property Name="Id" Type="Edm.String" 
Nullable="false" MaxLength="10" sap:label="ID" sap:updatable="false"/>
+                               <Property Name="ContentItemId" 
Type="Edm.String" MaxLength="5" sap:label="Content Item No." 
sap:updatable="false"/>
+                               <Property Name="RecommendationScenarioId" 
Type="Edm.String" MaxLength="50" sap:label="Scenario ID" sap:updatable="false"/>
+                       </EntityType>
+                       <Association Name="BusinessDocumentCompany" 
sap:content-version="1">
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" Multiplicity="1" 
Role="FromRole_BusinessDocumentCompany"/>
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.Company" Multiplicity="0..1" 
Role="ToRole_BusinessDocumentCompany"/>
+                       </Association>
+                       <Association Name="BusinessDocumentPerson" 
sap:content-version="1">
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" Multiplicity="1" 
Role="FromRole_BusinessDocumentPerson"/>
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.Person" Multiplicity="0..1" 
Role="ToRole_BusinessDocumentPerson"/>
+                       </Association>
+                       <Association Name="BusinessDocumentAdditionalObjectRef" 
sap:content-version="1">
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" Multiplicity="1" 
Role="FromRole_BusinessDocumentAdditionalObjectRef"/>
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.AdditionalObjectReference" 
Multiplicity="*" Role="ToRole_BusinessDocumentAdditionalObjectRef"/>
+                       </Association>
+                       <Association Name="BusinessDocumentOffer" 
sap:content-version="1">
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" Multiplicity="1" 
Role="FromRole_BusinessDocumentOffer"/>
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.Offer" Multiplicity="*" 
Role="ToRole_BusinessDocumentOffer"/>
+                       </Association>
+                       <Association Name="BusinessDocumentProductItem" 
sap:content-version="1">
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" Multiplicity="1" 
Role="FromRole_BusinessDocumentProductItem"/>
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.ProductItem" Multiplicity="*" 
Role="ToRole_BusinessDocumentProductItem"/>
+                       </Association>
+                       <Association Name="HeaderBusinessDocument" 
sap:content-version="1">
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.ImportHeader" Multiplicity="1" 
Role="FromRole_HeaderBusinessDocument"/>
+                               <End 
Type="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" Multiplicity="*" 
Role="ToRole_HeaderBusinessDocument"/>
+                       </Association>
+                       <EntityContainer 
Name="CUAN_BUSINESS_DOCUMENT_IMP_SRV_Entities" 
m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
+                               <EntitySet Name="ImportHeaders" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.ImportHeader" sap:updatable="false" 
sap:deletable="false" sap:pageable="false" sap:addressable="false" 
sap:content-version="1"/>
+                               <EntitySet Name="BusinessDocuments" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocument" 
sap:updatable="false" sap:deletable="false" sap:pageable="false" 
sap:addressable="false" sap:content-version="1"/>
+                               <EntitySet Name="Companies" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.Company" sap:updatable="false" 
sap:deletable="false" sap:pageable="false" sap:addressable="false" 
sap:content-version="1"/>
+                               <EntitySet Name="Persons" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.Person" sap:updatable="false" 
sap:deletable="false" sap:pageable="false" sap:addressable="false" 
sap:content-version="1"/>
+                               <EntitySet Name="ProductItems" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.ProductItem" sap:updatable="false" 
sap:deletable="false" sap:pageable="false" sap:addressable="false" 
sap:content-version="1"/>
+                               <EntitySet Name="AdditionalObjectReferences" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.AdditionalObjectReference" 
sap:updatable="false" sap:deletable="false" sap:pageable="false" 
sap:addressable="false" sap:content-version="1"/>
+                               <EntitySet Name="Offers" 
EntityType="CUAN_BUSINESS_DOCUMENT_IMP_SRV.Offer" sap:updatable="false" 
sap:deletable="false" sap:pageable="false" sap:addressable="false" 
sap:content-version="1"/>
+                               <AssociationSet 
Name="BusinessDocumentOffer_AssocSet" 
Association="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentOffer" 
sap:creatable="false" sap:updatable="false" sap:deletable="false" 
sap:content-version="1">
+                                       <End EntitySet="BusinessDocuments" 
Role="FromRole_BusinessDocumentOffer"/>
+                                       <End EntitySet="Offers" 
Role="ToRole_BusinessDocumentOffer"/>
+                               </AssociationSet>
+                               <AssociationSet 
Name="BusinessDocumentProductItems" 
Association="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentProductItem" 
sap:creatable="false" sap:updatable="false" sap:deletable="false" 
sap:content-version="1">
+                                       <End EntitySet="BusinessDocuments" 
Role="FromRole_BusinessDocumentProductItem"/>
+                                       <End EntitySet="ProductItems" 
Role="ToRole_BusinessDocumentProductItem"/>
+                               </AssociationSet>
+                               <AssociationSet 
Name="BusinessDocumentCompany_AssocSet" 
Association="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentCompany" 
sap:creatable="false" sap:updatable="false" sap:deletable="false" 
sap:content-version="1">
+                                       <End EntitySet="BusinessDocuments" 
Role="FromRole_BusinessDocumentCompany"/>
+                                       <End EntitySet="Companies" 
Role="ToRole_BusinessDocumentCompany"/>
+                               </AssociationSet>
+                               <AssociationSet 
Name="BusinessDocumentAdditionalObjectRef_Asso" 
Association="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentAdditionalObjectRef"
 sap:creatable="false" sap:updatable="false" sap:deletable="false" 
sap:content-version="1">
+                                       <End EntitySet="BusinessDocuments" 
Role="FromRole_BusinessDocumentAdditionalObjectRef"/>
+                                       <End 
EntitySet="AdditionalObjectReferences" 
Role="ToRole_BusinessDocumentAdditionalObjectRef"/>
+                               </AssociationSet>
+                               <AssociationSet 
Name="BusinessDocumentPerson_AssocSet" 
Association="CUAN_BUSINESS_DOCUMENT_IMP_SRV.BusinessDocumentPerson" 
sap:creatable="false" sap:updatable="false" sap:deletable="false" 
sap:content-version="1">
+                                       <End EntitySet="BusinessDocuments" 
Role="FromRole_BusinessDocumentPerson"/>
+                                       <End EntitySet="Persons" 
Role="ToRole_BusinessDocumentPerson"/>
+                               </AssociationSet>
+                               <AssociationSet 
Name="HeaderBusinessDocument_AssocSet" 
Association="CUAN_BUSINESS_DOCUMENT_IMP_SRV.HeaderBusinessDocument" 
sap:creatable="false" sap:updatable="false" sap:deletable="false" 
sap:content-version="1">
+                                       <End EntitySet="ImportHeaders" 
Role="FromRole_HeaderBusinessDocument"/>
+                                       <End EntitySet="BusinessDocuments" 
Role="ToRole_HeaderBusinessDocument"/>
+                               </AssociationSet>
+                       </EntityContainer>
+                       <atom:link rel="self" 
href="https://ldciana.wdf.sap.corp:44300/sap/opu/odata/sap/CUAN_BUSINESS_DOCUMENT_IMP_SRV/$metadata";
 xmlns:atom="http://www.w3.org/2005/Atom"/>
+                       <atom:link rel="latest-version" 
href="https://ldciana.wdf.sap.corp:44300/sap/opu/odata/sap/CUAN_BUSINESS_DOCUMENT_IMP_SRV/$metadata";
 xmlns:atom="http://www.w3.org/2005/Atom"/>
+               </Schema>
+       </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-client-core/src/test/resources/metadataProducts.xml
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-client-core/src/test/resources/metadataProducts.xml 
b/odata2-lib/odata-client-core/src/test/resources/metadataProducts.xml
new file mode 100644
index 0000000..0a10a93
--- /dev/null
+++ b/odata2-lib/odata-client-core/src/test/resources/metadataProducts.xml
@@ -0,0 +1,69 @@
+<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"; 
Version="1.0">
+       <edmx:DataServices 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; 
m:DataServiceVersion="2.0">
+               <Schema 
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"; 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; 
xmlns="http://schemas.microsoft.com/ado/2007/05/edm"; Namespace="ODataDemo">
+                       <EntityType Name="Product">
+                               <Key>
+                                       <PropertyRef Name="ID"/>
+                               </Key>
+                               <Property Name="ID" Type="Edm.Int32" 
Nullable="false"/>
+                               <Property Name="Name" Type="Edm.String" 
Nullable="true" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" 
m:FC_KeepInContent="false"/>
+                               <Property Name="Description" Type="Edm.String" 
Nullable="true" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" 
m:FC_KeepInContent="false"/>
+                               <Property Name="ReleaseDate" 
Type="Edm.DateTime" Nullable="false"/>
+                               <Property Name="DiscontinuedDate" 
Type="Edm.DateTime" Nullable="true"/>
+                               <Property Name="Rating" Type="Edm.Int32" 
Nullable="false"/>
+                               <Property Name="Price" Type="Edm.Decimal" 
Nullable="false"/>
+                               <NavigationProperty Name="Category" 
Relationship="ODataDemo.Product_Category_Category_Products" 
FromRole="Product_Category" ToRole="Category_Products"/>
+                               <NavigationProperty Name="Supplier" 
Relationship="ODataDemo.Product_Supplier_Supplier_Products" 
FromRole="Product_Supplier" ToRole="Supplier_Products"/>
+                       </EntityType>
+                       <EntityType Name="Category">
+                               <Key>
+                                       <PropertyRef Name="ID"/>
+                               </Key>
+                               <Property Name="ID" Type="Edm.Int32" 
Nullable="false"/>
+                               <Property Name="Name" Type="Edm.String" 
Nullable="true" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" 
m:FC_KeepInContent="true"/>
+                               <NavigationProperty Name="Products" 
Relationship="ODataDemo.Product_Category_Category_Products" 
FromRole="Category_Products" ToRole="Product_Category"/>
+                       </EntityType>
+                       <EntityType Name="Supplier">
+                               <Key>
+                                       <PropertyRef Name="ID"/>
+                               </Key>
+                               <Property Name="ID" Type="Edm.Int32" 
Nullable="false"/>
+                               <Property Name="Name" Type="Edm.String" 
Nullable="true" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" 
m:FC_KeepInContent="true"/>
+                               <Property Name="Address" 
Type="ODataDemo.Address" Nullable="false"/>
+                               <Property Name="Concurrency" Type="Edm.Int32" 
Nullable="false" ConcurrencyMode="Fixed"/>
+                               <NavigationProperty Name="Products" 
Relationship="ODataDemo.Product_Supplier_Supplier_Products" 
FromRole="Supplier_Products" ToRole="Product_Supplier"/>
+                       </EntityType>
+                       <ComplexType Name="Address">
+                               <Property Name="Street" Type="Edm.String" 
Nullable="true"/>
+                               <Property Name="City" Type="Edm.String" 
Nullable="true"/>
+                               <Property Name="State" Type="Edm.String" 
Nullable="true"/>
+                               <Property Name="ZipCode" Type="Edm.String" 
Nullable="true"/>
+                               <Property Name="Country" Type="Edm.String" 
Nullable="true"/>
+                       </ComplexType>
+                       <Association Name="Product_Category_Category_Products">
+                               <End Role="Product_Category" 
Type="ODataDemo.Product" Multiplicity="*"/>
+                               <End Role="Category_Products" 
Type="ODataDemo.Category" Multiplicity="0..1"/>
+                       </Association>
+                       <Association Name="Product_Supplier_Supplier_Products">
+                               <End Role="Product_Supplier" 
Type="ODataDemo.Product" Multiplicity="*"/>
+                               <End Role="Supplier_Products" 
Type="ODataDemo.Supplier" Multiplicity="0..1"/>
+                       </Association>
+                       <EntityContainer Name="DemoService" 
m:IsDefaultEntityContainer="true">
+                               <EntitySet Name="Products" 
EntityType="ODataDemo.Product"/>
+                               <EntitySet Name="Categories" 
EntityType="ODataDemo.Category"/>
+                               <EntitySet Name="Suppliers" 
EntityType="ODataDemo.Supplier"/>
+                               <AssociationSet 
Name="Products_Category_Categories" 
Association="ODataDemo.Product_Category_Category_Products">
+                                       <End Role="Product_Category" 
EntitySet="Products"/>
+                                       <End Role="Category_Products" 
EntitySet="Categories"/>
+                               </AssociationSet>
+                               <AssociationSet 
Name="Products_Supplier_Suppliers" 
Association="ODataDemo.Product_Supplier_Supplier_Products">
+                                       <End Role="Product_Supplier" 
EntitySet="Products"/>
+                                       <End Role="Supplier_Products" 
EntitySet="Suppliers"/>
+                               </AssociationSet>
+                               <FunctionImport Name="GetProductsByRating" 
EntitySet="Products" ReturnType="Collection(ODataDemo.Product)" 
m:HttpMethod="GET">
+                                       <Parameter Name="rating" 
Type="Edm.Int32" Mode="In"/>
+                               </FunctionImport>
+                       </EntityContainer>
+               </Schema>
+       </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-client-core/src/test/resources/metadataWithNavigations.xml
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-client-core/src/test/resources/metadataWithNavigations.xml 
b/odata2-lib/odata-client-core/src/test/resources/metadataWithNavigations.xml
new file mode 100644
index 0000000..3adf75d
--- /dev/null
+++ 
b/odata2-lib/odata-client-core/src/test/resources/metadataWithNavigations.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edmx:Edmx Version="1.0" 
xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"; 
xmlns:atom="http://www.w3.org/2005/Atom";>
+       <edmx:DataServices m:DataServiceVersion="2.0" 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";>
+               <Schema Namespace="ODataSet" 
xmlns="http://schemas.microsoft.com/ado/2008/09/edm"; >
+                       <EntityContainer Name="EntityContainer" 
m:IsDefaultEntityContainer="true">
+                               <EntitySet Name="User" 
EntityType="ODataNS.User" />                     
+                       </EntityContainer>
+               </Schema>
+               <Schema Namespace="ODataNS" 
xmlns="http://schemas.microsoft.com/ado/2008/09/edm"; >
+                       <EntityType Name="User">
+                               <Key>
+                                       <PropertyRef Name="userId"/>
+                               </Key>
+                                               <Property Name="userId" 
Type="Edm.String" Nullable="false"  MaxLength="100" />
+                                       </EntityType>
+                       
+               </Schema>
+       </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriParserImpl.java
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriParserImpl.java
 
b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriParserImpl.java
index b7e9c18..47cfa4f 100644
--- 
a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriParserImpl.java
+++ 
b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/uri/UriParserImpl.java
@@ -112,6 +112,7 @@ public class UriParserImpl extends UriParser {
     return parseAll(pathSegments, 
convertFromSingleMapToMultiMap(queryParameters));
   }
 
+  
   @Override
   public UriInfo parseAll(final List<PathSegment> pathSegments, final 
Map<String, List<String>> allQueryParameters)
       throws UriSyntaxException, UriNotMatchingException, EdmException {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-core/src/main/resources/i18n.properties
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/resources/i18n.properties 
b/odata2-lib/odata-core/src/main/resources/i18n.properties
index 000ad1b..b002b0e 100644
--- a/odata2-lib/odata-core/src/main/resources/i18n.properties
+++ b/odata2-lib/odata-core/src/main/resources/i18n.properties
@@ -66,13 +66,15 @@ 
org.apache.olingo.odata2.api.edm.EdmLiteralException.NOTEXT=An exception occurre
 org.apache.olingo.odata2.api.edm.EdmLiteralException.LITERALFORMAT=Wrong 
literal format for literal: '%1$s'.
 org.apache.olingo.odata2.api.edm.EdmLiteralException.UNKNOWNLITERAL=Unknown 
literal: '%1$s'.
 
+org.apache.olingo.odata2.api.edm.EdmException.TYPEPROBLEM=Type not defined.
+org.apache.olingo.odata2.api.edm.EdmException.ENTITYTYPEPROBLEM=Entity Type 
not defined.
 org.apache.olingo.odata2.api.edm.EdmException.COMMON=An exception occurred.
 org.apache.olingo.odata2.api.edm.EdmException.PROVIDERPROBLEM=A problem has 
been detected in the metadata provided by the EDM provider.
 org.apache.olingo.odata2.api.edm.EdmException.PROPERTYNOTFOUND=Invalid 
property with name '%1$s'
 
org.apache.olingo.odata2.api.edm.EdmException.NAVIGATIONPROPERTYNOTFOUND=Invalid
 navigation property with name '%1$s'
 org.apache.olingo.odata2.api.edm.EdmException.MUSTBENAVIGATIONPROPERTY=The 
found typed value for '%1$s' must be a navigation property but is not.
 org.apache.olingo.odata2.api.edm.EdmException.MUSTBEPROPERTY=The found typed 
value for '%1$s' must be a property but is not.
-
+org.apache.olingo.odata2.api.edm.EdmException.ASSOCIATIONNOTFOUND=Association 
not found.
 org.apache.olingo.odata2.api.edm.EdmSimpleTypeException.COMMON=An exception 
occurred.
 
org.apache.olingo.odata2.api.edm.EdmSimpleTypeException.LITERAL_KIND_MISSING=The
 literal kind is missing.
 
org.apache.olingo.odata2.api.edm.EdmSimpleTypeException.LITERAL_KIND_NOT_SUPPORTED=The
 literal kind '%1$s' is not supported.
@@ -117,6 +119,9 @@ 
org.apache.olingo.odata2.api.ep.EntityProviderException.MEDIA_DATA_NOT_INITIAL=R
 
org.apache.olingo.odata2.api.ep.EntityProviderException.END_DOCUMENT_EXPECTED=End
 of document expected but was '%1$s'.
 
org.apache.olingo.odata2.api.ep.EntityProviderException.MISSING_RESULTS_ARRAY=Mandatory
 results array not found.
 
org.apache.olingo.odata2.api.ep.EntityProviderException.INVALID_DELETED_ENTRY_METADATA=Invalid
 delete entry data format (Atom XML Tombstone or Json) 
+org.apache.olingo.odata2.api.ep.EntityProviderException.NULL_VALUE=Entity or 
expanded entity cannot have null value.
+org.apache.olingo.odata2.api.ep.EntityProviderException.INCORRECT_NAVIGATION_TYPE=Navigation
 has to be either an Entity or a Map.
+org.apache.olingo.odata2.api.ep.EntityProviderException.MANDATORY_WRITE_PROPERTY=Write
 properties are mandatory for XML.
 
 ##################################
 # BatchParserexceptions

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/mock/EdmMock.java
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/mock/EdmMock.java
 
b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/mock/EdmMock.java
index b8cb129..f0e4782 100644
--- 
a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/mock/EdmMock.java
+++ 
b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/mock/EdmMock.java
@@ -209,6 +209,22 @@ class EdmMock {
     
when(employeeSearchParameter.getType()).thenReturn(EdmSimpleTypeKind.String.getEdmSimpleTypeInstance());
     
when(employeeSearchFunctionImport.getParameterNames()).thenReturn(Arrays.asList("q"));
     
when(employeeSearchFunctionImport.getParameter("q")).thenReturn(employeeSearchParameter);
+    when(employeeSearchParameter.getName()).thenReturn("q");
+    
+    EdmFunctionImport buildingSearchFunctionImport =
+        createFunctionImportMock(defaultContainer, "BuildingSearch", 
employeeType, EdmMultiplicity.MANY);
+    
when(buildingSearchFunctionImport.getEntitySet()).thenReturn(buildingEntitySet);
+    EdmParameter buildingSearchParameter1 = mock(EdmParameter.class);
+    
when(buildingSearchParameter1.getType()).thenReturn(EdmSimpleTypeKind.String.getEdmSimpleTypeInstance());
+    
when(buildingSearchFunctionImport.getParameterNames()).thenReturn(Arrays.asList("q",
 "r"));
+    
when(buildingSearchFunctionImport.getParameter("q")).thenReturn(buildingSearchParameter1);
+    when(buildingSearchParameter1.getName()).thenReturn("q");
+    EdmParameter buildingSearchParameter2 = mock(EdmParameter.class);
+    
when(buildingSearchParameter2.getType()).thenReturn(EdmSimpleTypeKind.Int16.getEdmSimpleTypeInstance());
+    
when(buildingSearchFunctionImport.getParameter("r")).thenReturn(buildingSearchParameter2);
+    when(buildingSearchParameter2.getName()).thenReturn("r");
+    
+    
     createFunctionImportMock(defaultContainer, "AllLocations", 
locationComplexType, EdmMultiplicity.MANY);
     createFunctionImportMock(defaultContainer, "AllUsedRoomIds", 
EdmSimpleTypeKind.String.getEdmSimpleTypeInstance(),
         EdmMultiplicity.MANY);
@@ -223,18 +239,20 @@ class EdmMock {
     EdmFacets managerPhotoParameterFacets = mock(EdmFacets.class);
     when(managerPhotoParameterFacets.isNullable()).thenReturn(false);
     
when(managerPhotoParameter.getFacets()).thenReturn(managerPhotoParameterFacets);
+    when(managerPhotoParameter.getName()).thenReturn("Id");
     
when(managerPhotoFunctionImport.getParameterNames()).thenReturn(Arrays.asList("Id"));
     
when(managerPhotoFunctionImport.getParameter("Id")).thenReturn(managerPhotoParameter);
     EdmFunctionImport oldestEmployeeFunctionImport =
         createFunctionImportMock(defaultContainer, "OldestEmployee", 
employeeType, EdmMultiplicity.ONE);
     
when(oldestEmployeeFunctionImport.getEntitySet()).thenReturn(employeeEntitySet);
-
+    
     // Issue with not explicitly nullable parameters and facets
     EdmFunctionImport functionImportNullableParameter =
         createFunctionImportMock(defaultContainer, "FINullableParameter", 
EdmSimpleTypeKind.Boolean
             .getEdmSimpleTypeInstance(), EdmMultiplicity.ONE);
     EdmParameter nullableFIParameter = mock(EdmParameter.class);
     
when(nullableFIParameter.getType()).thenReturn(EdmSimpleTypeKind.String.getEdmSimpleTypeInstance());
+    when(nullableFIParameter.getName()).thenReturn("Id");
     EdmFacets nullableFIParameterFacets = mock(EdmFacets.class);
     when(nullableFIParameterFacets.isNullable()).thenReturn(null);
     when(nullableFIParameterFacets.getMaxLength()).thenReturn(new Integer(1));
@@ -320,6 +338,23 @@ class EdmMock {
     when(edm.getEntityType("RefScenario", "Company")).thenReturn(companyType);
     when(edm.getEntityType("RefScenario", 
"Organization")).thenReturn(organizationType);
     
+    EdmFunctionImport photoSearchFunctionImport =
+        createFunctionImportMock(photoContainer, "PhotoSearch", 
photoEntityType,
+            EdmMultiplicity.ONE);
+    when(photoSearchFunctionImport.getEntitySet()).thenReturn(photoEntitySet);
+    EdmParameter photoParameter1 = mock(EdmParameter.class);
+    
when(photoParameter1.getType()).thenReturn(EdmSimpleTypeKind.Int16.getEdmSimpleTypeInstance());
+    EdmFacets photoParameterFacets = mock(EdmFacets.class);
+    when(photoParameterFacets.isNullable()).thenReturn(true);
+    when(photoParameter1.getFacets()).thenReturn(photoParameterFacets);
+    when(photoParameter1.getName()).thenReturn("Id");
+    EdmParameter photoParameter2 = mock(EdmParameter.class);
+    
when(photoParameter2.getType()).thenReturn(EdmSimpleTypeKind.String.getEdmSimpleTypeInstance());
+    when(photoParameter2.getName()).thenReturn("Type");
+    
when(photoSearchFunctionImport.getParameterNames()).thenReturn(Arrays.asList("Id","Type"));
+    
when(photoSearchFunctionImport.getParameter("Id")).thenReturn(photoParameter1);
+    
when(photoSearchFunctionImport.getParameter("Type")).thenReturn(photoParameter2);
+    
     return edm;
   }
 
@@ -330,7 +365,8 @@ class EdmMock {
 
     EdmNavigationProperty navigationProperty = 
mock(EdmNavigationProperty.class);
     when(navigationProperty.getName()).thenReturn(name);
-    when(navigationProperty.getType()).thenReturn(navigationType);
+    EdmType type = targetEntitySet.getEntityType();
+    when(navigationProperty.getType()).thenReturn(type);
     when(navigationProperty.getMultiplicity()).thenReturn(multiplicity);
 
     
when(entitySet.getEntityType().getProperty(name)).thenReturn(navigationProperty);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9e949e40/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index 8e881e6..cc90cdd 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -29,6 +29,8 @@
         <module>odata-core</module>
         <module>odata-fit</module>
         <module>odata-ref</module>
-        <module>odata-web</module>
+        <module>odata-web</module>        
+               <module>odata-client-api</module>
+               <module>odata-client-core</module>
     </modules>
 </project>

Reply via email to