ruby_odata 0.0.10 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. data/.gitignore +9 -3
  2. data/.travis.yml +4 -0
  3. data/CHANGELOG.rdoc +18 -1
  4. data/README.rdoc +77 -19
  5. data/config/cucumber.yml +4 -3
  6. data/features/basic_auth.feature +5 -7
  7. data/features/batch_request.feature +11 -11
  8. data/features/complex_types.feature +11 -11
  9. data/features/query_builder.feature +27 -18
  10. data/features/service.feature +8 -8
  11. data/features/service_manage.feature +27 -12
  12. data/features/service_methods.feature +37 -0
  13. data/features/ssl.feature +4 -4
  14. data/features/step_definitions/pickle_steps.rb +100 -0
  15. data/features/step_definitions/service_steps.rb +99 -65
  16. data/features/support/constants.rb +3 -0
  17. data/features/support/custom_helpers.rb +54 -0
  18. data/features/support/env.rb +0 -10
  19. data/features/support/hooks.rb +1 -1
  20. data/features/support/pickle.rb +82 -0
  21. data/features/type_conversion.feature +10 -10
  22. data/lib/ruby_odata.rb +4 -1
  23. data/lib/ruby_odata/association.rb +36 -0
  24. data/lib/ruby_odata/class_builder.rb +96 -16
  25. data/lib/ruby_odata/helpers.rb +10 -0
  26. data/lib/ruby_odata/operation.rb +7 -5
  27. data/lib/ruby_odata/property_metadata.rb +11 -6
  28. data/lib/ruby_odata/query_builder.rb +20 -1
  29. data/lib/ruby_odata/service.rb +407 -94
  30. data/lib/ruby_odata/version.rb +1 -1
  31. data/ruby_odata.gemspec +2 -0
  32. data/spec/association_spec.rb +48 -0
  33. data/spec/class_builder_spec.rb +11 -2
  34. data/spec/fixtures/inheritance/edmx_pluralsight.xml +111 -0
  35. data/spec/fixtures/inheritance/result_pluralsight_courses.xml +229 -0
  36. data/spec/fixtures/links/result_links_query.xml +6 -0
  37. data/spec/fixtures/partial/partial_feed_metadata.xml +25 -0
  38. data/spec/fixtures/partial/partial_feed_part_1.xml +42 -0
  39. data/spec/fixtures/partial/partial_feed_part_2.xml +42 -0
  40. data/spec/fixtures/partial/partial_feed_part_3.xml +40 -0
  41. data/spec/fixtures/sample_service/edmx_categories_products.xml +1 -0
  42. data/spec/fixtures/sample_service/result_category_names.xml +5 -0
  43. data/spec/fixtures/sample_service/result_entity_category_web_get.xml +29 -0
  44. data/spec/fixtures/sample_service/result_entity_single_category_web_get.xml +23 -0
  45. data/spec/fixtures/sample_service/result_first_category_id.xml +2 -0
  46. data/spec/fixtures/sample_service/result_multiple_category_products.xml +57 -0
  47. data/spec/fixtures/sample_service/result_single_category.xml +18 -0
  48. data/spec/fixtures/sample_service/result_single_product.xml +26 -0
  49. data/spec/fixtures/sample_service/result_single_product_not_found.xml +4 -0
  50. data/spec/fixtures/sap/edmx_sap_demo_flight.xml +62 -58
  51. data/spec/property_metadata_spec.rb +9 -2
  52. data/spec/query_builder_spec.rb +11 -0
  53. data/spec/revised_service_spec.rb +197 -0
  54. data/spec/service_spec.rb +463 -4
  55. data/test/RubyODataService/RubyODataService.sln +20 -0
  56. data/test/RubyODataService/RubyODataService/App_Start/EntityFramework.SqlServerCompact.cs +12 -0
  57. data/test/RubyODataService/RubyODataService/BasicAuth/RubyOData.svc +3 -0
  58. data/test/RubyODataService/RubyODataService/BasicAuth/RubyOData.svc.cs +107 -0
  59. data/test/RubyODataService/RubyODataService/Global.asax +1 -0
  60. data/test/RubyODataService/RubyODataService/Global.asax.cs +49 -0
  61. data/test/RubyODataService/RubyODataService/Models/AuditFields.cs +16 -0
  62. data/test/RubyODataService/RubyODataService/Models/Category.cs +16 -0
  63. data/test/RubyODataService/RubyODataService/Models/Product.cs +20 -0
  64. data/test/RubyODataService/RubyODataService/Properties/AssemblyInfo.cs +35 -0
  65. data/test/RubyODataService/RubyODataService/RubyOData.svc +3 -0
  66. data/test/RubyODataService/RubyODataService/RubyOData.svc.cs +57 -0
  67. data/test/RubyODataService/RubyODataService/RubyODataContext.cs +16 -0
  68. data/test/RubyODataService/RubyODataService/RubyODataService.csproj +159 -0
  69. data/test/RubyODataService/RubyODataService/RubyODataService.csproj.user +31 -0
  70. data/test/RubyODataService/RubyODataService/Web.Debug.config +30 -0
  71. data/test/RubyODataService/RubyODataService/Web.Release.config +31 -0
  72. data/test/RubyODataService/RubyODataService/Web.config +27 -0
  73. data/test/RubyODataService/RubyODataService/bin/EntityFramework.dll +0 -0
  74. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Edm.dll +0 -0
  75. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.OData.dll +0 -0
  76. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Services.Client.dll +0 -0
  77. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Services.dll +0 -0
  78. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Spatial.dll +0 -0
  79. data/test/RubyODataService/RubyODataService/bin/RubyODataService.dll +0 -0
  80. data/test/RubyODataService/RubyODataService/bin/System.Data.SqlServerCe.Entity.dll +0 -0
  81. data/test/RubyODataService/RubyODataService/bin/System.Data.SqlServerCe.dll +0 -0
  82. data/test/RubyODataService/RubyODataService/bin/System.Spatial.dll +0 -0
  83. data/test/RubyODataService/RubyODataService/bin/WebActivator.dll +0 -0
  84. data/test/RubyODataService/RubyODataService/bin/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  85. data/test/RubyODataService/RubyODataService/bin/amd64/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  86. data/test/RubyODataService/RubyODataService/bin/amd64/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  87. data/test/RubyODataService/RubyODataService/bin/amd64/sqlcecompact40.dll +0 -0
  88. data/test/RubyODataService/RubyODataService/bin/amd64/sqlceer40EN.dll +0 -0
  89. data/test/RubyODataService/RubyODataService/bin/amd64/sqlceme40.dll +0 -0
  90. data/test/RubyODataService/RubyODataService/bin/amd64/sqlceqp40.dll +0 -0
  91. data/test/RubyODataService/RubyODataService/bin/amd64/sqlcese40.dll +0 -0
  92. data/test/RubyODataService/RubyODataService/bin/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  93. data/test/RubyODataService/RubyODataService/bin/x86/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  94. data/test/RubyODataService/RubyODataService/bin/x86/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  95. data/test/RubyODataService/RubyODataService/bin/x86/sqlcecompact40.dll +0 -0
  96. data/test/RubyODataService/RubyODataService/bin/x86/sqlceer40EN.dll +0 -0
  97. data/test/RubyODataService/RubyODataService/bin/x86/sqlceme40.dll +0 -0
  98. data/test/RubyODataService/RubyODataService/bin/x86/sqlceqp40.dll +0 -0
  99. data/test/RubyODataService/RubyODataService/bin/x86/sqlcese40.dll +0 -0
  100. data/test/RubyODataService/RubyODataService/packages.config +7 -0
  101. data/test/RubyODataService/packages/EntityFramework.4.2.0.0/EntityFramework.4.2.0.0.nupkg +0 -0
  102. data/test/RubyODataService/packages/EntityFramework.4.2.0.0/lib/net40/EntityFramework.dll +0 -0
  103. data/test/RubyODataService/packages/EntityFramework.4.2.0.0/lib/net40/EntityFramework.xml +13488 -0
  104. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/Content/App_Start/EntityFramework.SqlServerCompact.cs.pp +12 -0
  105. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/EULA_ENU.rtf +969 -0
  106. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/EntityFramework.SqlServerCompact.4.1.8482.2.nupkg +0 -0
  107. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/lib/System.Data.SqlServerCe.Entity.dll +0 -0
  108. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/tools/install.ps1 +3 -0
  109. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Content/web.config.transform +8 -0
  110. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  111. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  112. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  113. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcecompact40.dll +0 -0
  114. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceer40EN.dll +0 -0
  115. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceme40.dll +0 -0
  116. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceqp40.dll +0 -0
  117. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcese40.dll +0 -0
  118. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  119. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  120. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  121. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcecompact40.dll +0 -0
  122. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceer40EN.dll +0 -0
  123. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceme40.dll +0 -0
  124. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceqp40.dll +0 -0
  125. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcese40.dll +0 -0
  126. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/SQLCE_EULA_ENU.rtf +778 -0
  127. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/SqlServerCompact.4.0.8482.1.nupkg +0 -0
  128. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Tools/GetSqlCEPostBuildCmd.ps1 +12 -0
  129. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Tools/install.ps1 +11 -0
  130. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Tools/uninstall.ps1 +9 -0
  131. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/lib/System.Data.SqlServerCe.dll +0 -0
  132. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/DataSvcUtil.exe +0 -0
  133. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/License.rtf +708 -0
  134. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Edm.dll +0 -0
  135. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Edm.xml +4150 -0
  136. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.OData.dll +0 -0
  137. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.OData.xml +1969 -0
  138. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Client.dll +0 -0
  139. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Client.xml +1442 -0
  140. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Design.dll +0 -0
  141. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Design.xml +191 -0
  142. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.dll +0 -0
  143. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.xml +2559 -0
  144. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Spatial.dll +0 -0
  145. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Spatial.xml +15 -0
  146. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.VsDesigner.DataServices.Adapter.dll +0 -0
  147. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/README.txt +6 -0
  148. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/System.Spatial.dll +0 -0
  149. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/System.Spatial.xml +2276 -0
  150. data/test/RubyODataService/packages/WebActivator.1.0.0.0/WebActivator.1.0.0.0.nupkg +0 -0
  151. data/test/RubyODataService/packages/WebActivator.1.0.0.0/lib/WebActivator.dll +0 -0
  152. data/test/RubyODataService/packages/repositories.config +4 -0
  153. data/test/applicationhost.config.template +2 -2
  154. data/test/blueprints.rb +5 -4
  155. data/test/iisExpress x64.bat b/data/test/iisExpress → x64.bat +0 -0
  156. data/test/iisExpress x86.bat b/data/test/iisExpress → x86.bat +0 -0
  157. data/test/setpath.rb +13 -3
  158. data/test/usage_samples/querying.rb +45 -0
  159. data/test/usage_samples/reflection.rb +16 -0
  160. data/test/usage_samples/sample_data.rb +30 -0
  161. metadata +327 -36
  162. data/test/Cassini x64.bat +0 -1
  163. data/test/Cassini x86.bat +0 -1
  164. data/test/SampleService/App_Code/AuditFields.cs +0 -13
  165. data/test/SampleService/App_Code/Entities.cs +0 -145
  166. data/test/SampleService/App_Code/Model.Designer.cs +0 -578
  167. data/test/SampleService/App_Code/Model.edmx +0 -157
  168. data/test/SampleService/App_Code/ModelContainerExtended.cs +0 -32
  169. data/test/SampleService/App_Data/_TestDB.mdf +0 -0
  170. data/test/SampleService/App_Data/_TestDB_Log.ldf +0 -0
  171. data/test/SampleService/BasicAuth/Entities.svc +0 -1
  172. data/test/SampleService/Entities.svc +0 -1
  173. data/test/SampleService/web.config +0 -37
@@ -0,0 +1,42 @@
1
+ <feed xml:base="http://test.com/test.svc/"
2
+ xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
3
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
4
+ xmlns="http://www.w3.org/2005/Atom">
5
+ <title type="text">Partials</title>
6
+ <id>http://test.com/test.svc/Partials</id>
7
+ <updated>2010-03-10T09:34:11Z</updated>
8
+ <link rel="self" title="Partials" href="Partials" />
9
+ <m:count>3</m:count>
10
+ <entry>
11
+ <id>http://test.com/test.svc/Partials</id>
12
+ <title type="text" />
13
+ <updated>2010-03-10T09:34:11Z</updated>
14
+ <author>
15
+ <name />
16
+ </author>
17
+ <link rel="edit" title="Customer" href="Customers('ALFKI')" />
18
+ <link
19
+ rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CustomerDemographics"
20
+ type="application/atom+xml;type=feed"
21
+ title="CustomerDemographics" href="Partials/CustomerDemographics" />
22
+ <category term="Partial"
23
+ scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
24
+ <content type="application/xml">
25
+ <m:properties>
26
+ <d:CustomerID>ALFKI</d:CustomerID>
27
+ <d:CompanyName>Alfreds Futterkiste</d:CompanyName>
28
+ <d:ContactName>Maria Anders</d:ContactName>
29
+ <d:ContactTitle>Sales Representative</d:ContactTitle>
30
+ <d:Address>Obere Str. 57</d:Address>
31
+ <d:City>Berlin</d:City>
32
+ <d:Region m:null="true" />
33
+ <d:PostalCode>12209</d:PostalCode>
34
+ <d:Country>Germany</d:Country>
35
+ <d:Phone>030-0074321</d:Phone>
36
+ <d:Fax>030-0076545</d:Fax>
37
+ </m:properties>
38
+ </content>
39
+ </entry>
40
+ <link rel="next"
41
+ href="http://test.com/test.svc/Partials?$skiptoken='ERNSH'" />
42
+ </feed>
@@ -0,0 +1,42 @@
1
+ <feed xml:base="http://test.com/test.svc/"
2
+ xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
3
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
4
+ xmlns="http://www.w3.org/2005/Atom">
5
+ <title type="text">Partials</title>
6
+ <id>http://test.com/test.svc/Partials</id>
7
+ <updated>2010-03-10T09:34:11Z</updated>
8
+ <link rel="self" title="Partials" href="Partials?$skiptoken='ERNSH'" />
9
+ <m:count>2</m:count>
10
+ <entry>
11
+ <id>http://test.com/test.svc/Partials?$skiptoken='ERNSH'</id>
12
+ <title type="text" />
13
+ <updated>2010-03-10T09:34:11Z</updated>
14
+ <author>
15
+ <name />
16
+ </author>
17
+ <link rel="edit" title="Customer" href="Partials?$skiptoken='ERNSH'" />
18
+ <link
19
+ rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CustomerDemographics"
20
+ type="application/atom+xml;type=feed"
21
+ title="CustomerDemographics" href="Partials/CustomerDemographics" />
22
+ <category term="Partial"
23
+ scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
24
+ <content type="application/xml">
25
+ <m:properties>
26
+ <d:CustomerID>ALFKI</d:CustomerID>
27
+ <d:CompanyName>Alfreds Futterkiste</d:CompanyName>
28
+ <d:ContactName>Maria Sanders</d:ContactName>
29
+ <d:ContactTitle>Sales Manager</d:ContactTitle>
30
+ <d:Address>Obere Str. 57</d:Address>
31
+ <d:City>Berlin</d:City>
32
+ <d:Region m:null="true" />
33
+ <d:PostalCode>12209</d:PostalCode>
34
+ <d:Country>Germany</d:Country>
35
+ <d:Phone>030-0074321</d:Phone>
36
+ <d:Fax>030-0076545</d:Fax>
37
+ </m:properties>
38
+ </content>
39
+ </entry>
40
+ <link rel="next"
41
+ href="http://test.com/test.svc/Partials?$skiptoken='ERNSH2'" />
42
+ </feed>
@@ -0,0 +1,40 @@
1
+ <feed xml:base="http://test.com/test.svc/"
2
+ xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
3
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
4
+ xmlns="http://www.w3.org/2005/Atom">
5
+ <title type="text">Partials</title>
6
+ <id>http://test.com/test.svc/Partials</id>
7
+ <updated>2010-03-10T09:34:11Z</updated>
8
+ <link rel="self" title="Partials" href="Partials?$skiptoken='ERNSH2'" />
9
+ <m:count>2</m:count>
10
+ <entry>
11
+ <id>http://test.com/test.svc/Partials?$skiptoken='ERNSH2'</id>
12
+ <title type="text" />
13
+ <updated>2010-03-10T09:34:11Z</updated>
14
+ <author>
15
+ <name />
16
+ </author>
17
+ <link rel="edit" title="Customer" href="Partials?$skiptoken='ERNSH2'" />
18
+ <link
19
+ rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CustomerDemographics"
20
+ type="application/atom+xml;type=feed"
21
+ title="CustomerDemographics" href="Partials/CustomerDemographics" />
22
+ <category term="Partial"
23
+ scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
24
+ <content type="application/xml">
25
+ <m:properties>
26
+ <d:CustomerID>ALFKI</d:CustomerID>
27
+ <d:CompanyName>Alfreds Futterkiste</d:CompanyName>
28
+ <d:ContactName>Maria Banders</d:ContactName>
29
+ <d:ContactTitle>Sales Damager</d:ContactTitle>
30
+ <d:Address>Obere Str. 57</d:Address>
31
+ <d:City>Berlin</d:City>
32
+ <d:Region m:null="true" />
33
+ <d:PostalCode>12209</d:PostalCode>
34
+ <d:Country>Germany</d:Country>
35
+ <d:Phone>030-0074321</d:Phone>
36
+ <d:Fax>030-0076545</d:Fax>
37
+ </m:properties>
38
+ </content>
39
+ </entry>
40
+ </feed>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?><edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema Namespace="RubyODataService" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType Name="Product"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true" /><Property Name="Price" Type="Edm.Decimal" Nullable="false" Precision="18" Scale="2" /><Property Name="DiscontinuedDate" Type="Edm.DateTime" /><Property Name="CategoryId" Type="Edm.Int32" Nullable="false" /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false" /><NavigationProperty Name="Category" Relationship="RubyODataService.Category_Products" ToRole="Category_Products_Source" FromRole="Category_Products_Target" /></EntityType><ComplexType Name="AuditFields"><Property Name="CreateDate" Type="Edm.DateTime" Nullable="false" /><Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" /><Property Name="CreatedBy" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true" /></ComplexType><EntityType Name="Category"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true" /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false" /><NavigationProperty Name="Products" Relationship="RubyODataService.Category_Products" ToRole="Category_Products_Target" FromRole="Category_Products_Source" /></EntityType><EntityType Name="EdmMetadata"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="ModelHash" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true" /></EntityType><Association Name="Category_Products"><End Type="RubyODataService.Product" Role="Category_Products_Target" Multiplicity="*" /><End Type="RubyODataService.Category" Role="Category_Products_Source" Multiplicity="1"><OnDelete Action="Cascade" /></End><ReferentialConstraint><Principal Role="Category_Products_Source"><PropertyRef Name="Id" /></Principal><Dependent Role="Category_Products_Target"><PropertyRef Name="CategoryId" /></Dependent></ReferentialConstraint></Association><EntityContainer Name="RubyODataContext" m:IsDefaultEntityContainer="true"><EntitySet Name="Products" EntityType="RubyODataService.Product" /><EntitySet Name="Categories" EntityType="RubyODataService.Category" /><EntitySet Name="EdmMetadatas" EntityType="RubyODataService.EdmMetadata" /><AssociationSet Name="Category_Products" Association="RubyODataService.Category_Products"><End Role="Category_Products_Target" EntitySet="Products" /><End Role="Category_Products_Source" EntitySet="Categories" /></AssociationSet><FunctionImport Name="CleanDatabaseForTesting" m:HttpMethod="POST" /><FunctionImport Name="EntityCategoryWebGet" ReturnType="Collection(RubyODataService.Category)" EntitySet="Categories" m:HttpMethod="GET" /><FunctionImport Name="CategoryNames" ReturnType="Collection(Edm.String)" m:HttpMethod="GET" /><FunctionImport Name="FirstCategoryId" ReturnType="Edm.Int32" m:HttpMethod="GET" /><FunctionImport Name="EntitySingleCategoryWebGet" ReturnType="RubyODataService.Category" EntitySet="Categories" m:HttpMethod="GET"><Parameter Name="id" Type="Edm.Int32" /></FunctionImport></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
@@ -0,0 +1,5 @@
1
+ <CategoryNames xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
2
+ <element>Test Category 1</element>
3
+ <element>Test Category 2</element>
4
+ <element>Test Category 3</element>
5
+ </CategoryNames>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <feed xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xml:base="http://win7dev:8989/SampleService/RubyOData.svc/">
3
+ <id>http://win7dev:8989/SampleService/RubyOData.svc/EntityCategoryWebGet</id>
4
+ <title type="text">EntityCategoryWebGet</title>
5
+ <updated>2011-11-28T02:43:29Z</updated>
6
+ <link rel="self" title="EntityCategoryWebGet" href="EntityCategoryWebGet"/>
7
+ <entry>
8
+ <id>http://win7dev:8989/SampleService/RubyOData.svc/Categories(1)</id>
9
+ <category term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
10
+ <link rel="edit" title="Category" href="Categories(1)"/>
11
+ <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products" type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"/>
12
+ <title/>
13
+ <updated>2011-11-28T02:43:29Z</updated>
14
+ <author>
15
+ <name/>
16
+ </author>
17
+ <content type="application/xml">
18
+ <m:properties>
19
+ <d:Id m:type="Edm.Int32">1</d:Id>
20
+ <d:Name>Test Category</d:Name>
21
+ <d:AuditFields m:type="RubyODataService.AuditFields">
22
+ <d:CreateDate m:type="Edm.DateTime">2011-11-28T02:42:58.407</d:CreateDate>
23
+ <d:ModifiedDate m:type="Edm.DateTime">2011-11-28T02:42:58.407</d:ModifiedDate>
24
+ <d:CreatedBy m:null="true"/>
25
+ </d:AuditFields>
26
+ </m:properties>
27
+ </content>
28
+ </entry>
29
+ </feed>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xml:base="http://win7dev:8989/SampleService/RubyOData.svc/">
3
+ <id>http://win7dev:8989/SampleService/RubyOData.svc/Categories(1)</id>
4
+ <category term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
5
+ <link rel="edit" title="Category" href="Categories(1)"/>
6
+ <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products" type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"/>
7
+ <title/>
8
+ <updated>2011-11-28T02:51:40Z</updated>
9
+ <author>
10
+ <name/>
11
+ </author>
12
+ <content type="application/xml">
13
+ <m:properties>
14
+ <d:Id m:type="Edm.Int32">1</d:Id>
15
+ <d:Name>Test Category</d:Name>
16
+ <d:AuditFields m:type="RubyODataService.AuditFields">
17
+ <d:CreateDate m:type="Edm.DateTime">2011-11-28T02:42:58.407</d:CreateDate>
18
+ <d:ModifiedDate m:type="Edm.DateTime">2011-11-28T02:42:58.407</d:ModifiedDate>
19
+ <d:CreatedBy m:null="true"/>
20
+ </d:AuditFields>
21
+ </m:properties>
22
+ </content>
23
+ </entry>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <d:FirstCategoryId xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:type="Edm.Int32">1</d:FirstCategoryId>
@@ -0,0 +1,57 @@
1
+ <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
2
+ <feed xml:base="http://test.com/test.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
3
+ <title type="text">Products</title>
4
+ <id>http://test.com/test.svc/Categories(1)/Products</id>
5
+ <updated>2011-11-13T21:29:28Z</updated>
6
+ <link rel="self" title="Products" href="Products" />
7
+ <entry>
8
+ <id>http://test.com/test.svc/Products(1)</id>
9
+ <title type="text"></title>
10
+ <updated>2011-11-13T21:29:28Z</updated>
11
+ <author>
12
+ <name />
13
+ </author>
14
+ <link rel="edit" title="Product" href="Products(1)" />
15
+ <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category" />
16
+ <category term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
17
+ <content type="application/xml">
18
+ <m:properties>
19
+ <d:Id m:type="Edm.Int32">1</d:Id>
20
+ <d:Name>Widget 1</d:Name>
21
+ <d:Description>Test Widget</d:Description>
22
+ <d:Price m:type="Edm.Decimal">7.5000</d:Price>
23
+ <d:DiscontinuedDate m:type="Edm.DateTime" m:null="true" />
24
+ <d:AuditFields m:type="RubyODataService.AuditFields">
25
+ <d:CreateDate m:type="Edm.DateTime">2011-11-13T05:00:23.547</d:CreateDate>
26
+ <d:ModifiedDate m:type="Edm.DateTime">2011-11-13T05:00:23.547</d:ModifiedDate>
27
+ <d:CreatedBy>Cucumber</d:CreatedBy>
28
+ </d:AuditFields>
29
+ </m:properties>
30
+ </content>
31
+ </entry>
32
+ <entry>
33
+ <id>http://test.com/test.svc/Products(2)</id>
34
+ <title type="text"></title>
35
+ <updated>2011-11-13T21:29:28Z</updated>
36
+ <author>
37
+ <name />
38
+ </author>
39
+ <link rel="edit" title="Product" href="Products(2)" />
40
+ <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(2)/Category" />
41
+ <category term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
42
+ <content type="application/xml">
43
+ <m:properties>
44
+ <d:Id m:type="Edm.Int32">2</d:Id>
45
+ <d:Name>Widget 2</d:Name>
46
+ <d:Description>Test Widget 2</d:Description>
47
+ <d:Price m:type="Edm.Decimal">17.5000</d:Price>
48
+ <d:DiscontinuedDate m:type="Edm.DateTime" m:null="true" />
49
+ <d:AuditFields m:type="RubyODataService.AuditFields">
50
+ <d:CreateDate m:type="Edm.DateTime">2011-11-13T05:00:23.547</d:CreateDate>
51
+ <d:ModifiedDate m:type="Edm.DateTime">2011-11-13T05:00:23.547</d:ModifiedDate>
52
+ <d:CreatedBy>Cucumber</d:CreatedBy>
53
+ </d:AuditFields>
54
+ </m:properties>
55
+ </content>
56
+ </entry>
57
+ </feed>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
2
+ <entry xml:base="http://test.com/test.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
3
+ <id>http://test.com/test.svc/Categories(1)</id>
4
+ <title type="text"></title>
5
+ <updated>2011-11-13T05:37:35Z</updated>
6
+ <author>
7
+ <name />
8
+ </author>
9
+ <link rel="edit" title="Category" href="Categories(1)" />
10
+ <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products" type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products" />
11
+ <category term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
12
+ <content type="application/xml">
13
+ <m:properties>
14
+ <d:Id m:type="Edm.Int32">1</d:Id>
15
+ <d:Name>Category 1</d:Name>
16
+ </m:properties>
17
+ </content>
18
+ </entry>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
2
+ <entry xml:base="http://test.com/test.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
3
+ <id>http://test.com/test.svc/Products(1)</id>
4
+ <title type="text"></title>
5
+ <updated>2011-11-13T02:51:18Z</updated>
6
+ <author>
7
+ <name />
8
+ </author>
9
+ <link rel="edit" title="Product" href="Products(1)" />
10
+ <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category" />
11
+ <category term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
12
+ <content type="application/xml">
13
+ <m:properties>
14
+ <d:Id m:type="Edm.Int32">1</d:Id>
15
+ <d:Name>Widget 1</d:Name>
16
+ <d:Description>Test Widget</d:Description>
17
+ <d:Price m:type="Edm.Decimal">7.5000</d:Price>
18
+ <d:DiscontinuedDate m:type="Edm.DateTime" m:null="true" />
19
+ <d:AuditFields m:type="RubyODataService.AuditFields">
20
+ <d:CreateDate m:type="Edm.DateTime">2011-11-13T01:10:06.673</d:CreateDate>
21
+ <d:ModifiedDate m:type="Edm.DateTime">2011-11-13T01:10:06.673</d:ModifiedDate>
22
+ <d:CreatedBy>Cucumber</d:CreatedBy>
23
+ </d:AuditFields>
24
+ </m:properties>
25
+ </content>
26
+ </entry>
@@ -0,0 +1,4 @@
1
+ <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
2
+ <code/>
3
+ <message xml:lang="en-US">Resource not found for the segment 'Products'.</message>
4
+ </error>
@@ -1,61 +1,65 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:gp="http://www.sap.com/Protocols/SAPData/GenericPlayer" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
3
- <edmx:DataServices m:DataServiceVersion="2.0">
4
- <Schema Namespace="DEMO_FLIGHT" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
5
- <EntityType Name="flight_data" m:HasStream="false" sap:content-version="1">
6
- <Key>
7
- <PropertyRef Name="scheme_id"/>
8
- <PropertyRef Name="value"/>
9
- <PropertyRef Name="scheme_agency_id"/>
10
- </Key>
11
- <Property Name="scheme_id" Type="Edm.String" Nullable="false" MaxLength="30" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
12
- <Property Name="airlineid" Type="Edm.String" MaxLength="3" sap:label="Airline" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
13
- <Property Name="value" Type="Edm.String" Nullable="false" MaxLength="72" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
14
- <Property Name="scheme_agency_id" Type="Edm.String" Nullable="false" MaxLength="16" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
15
- </EntityType>
16
- <EntityType Name="z_demo_flight" m:HasStream="false" sap:content-version="1">
17
- <Key>
18
- <PropertyRef Name="scheme_id"/>
19
- <PropertyRef Name="scheme_agency_id"/>
20
- <PropertyRef Name="value"/>
21
- </Key>
22
- <Property Name="cityto" Type="Edm.String" MaxLength="20" sap:label="Arrival city" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
23
- <Property Name="scheme_id" Type="Edm.String" Nullable="false" MaxLength="30" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
24
- <Property Name="curr" Type="Edm.String" MaxLength="5" sap:label="Airline local currency" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
25
- <Property Name="businmax" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
26
- <Property Name="arrdate" Type="Edm.DateTime" Precision="8" sap:label="Arrival date" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
27
- <Property Name="deptime" Type="Edm.Time" Precision="6" sap:label="Departure time" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
28
- <Property Name="firstmax" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
29
- <Property Name="price" Type="Edm.Decimal" Precision="23" Scale="4" sap:label="Airfare" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
30
- <Property Name="businfree" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
31
- <Property Name="scheme_agency_id" Type="Edm.String" Nullable="false" MaxLength="16" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
32
- <Property Name="airline" Type="Edm.String" MaxLength="20" sap:label="Airline" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
33
- <Property Name="economax" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
34
- <Property Name="cityfrom" Type="Edm.String" MaxLength="20" sap:label="Depart. city" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
35
- <Property Name="airportfr" Type="Edm.String" MaxLength="3" sap:label="Departure airport" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
36
- <Property Name="connectid" Type="Edm.String" MaxLength="4" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
37
- <Property Name="firstfree" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
38
- <Property Name="econofree" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
39
- <Property Name="airlineid" Type="Edm.String" MaxLength="2" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
40
- <Property Name="curr_iso" Type="Edm.String" MaxLength="3" sap:label="ISO code" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
41
- <Property Name="value" Type="Edm.String" Nullable="false" MaxLength="72" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
42
- <Property Name="flightdate" Type="Edm.DateTime" Nullable="true" Precision="0" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
43
- <Property Name="airportto" Type="Edm.String" MaxLength="3" sap:label="Destination airport" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
44
- <Property Name="arrtime" Type="Edm.Time" Precision="6" sap:label="Arrival Time" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
45
- <NavigationProperty Name="flight_data_r" Relationship="DEMO_FLIGHT.flight_data_r" FromRole="FromRole_z_demo_flight_flight_data" ToRole="ToRole_flight_data_z_demo_flight"/>
46
- </EntityType>
47
- <Association Name="flight_data_r" sap:content-version="1">
48
- <End Type="DEMO_FLIGHT.z_demo_flight" Multiplicity="0..1" Role="FromRole_z_demo_flight_flight_data"/>
49
- <End Type="DEMO_FLIGHT.flight_data" Multiplicity="0..1" Role="ToRole_flight_data_z_demo_flight"/>
50
- </Association>
51
- <EntityContainer Name="DEMO_FLIGHT" m:IsDefaultEntityContainer="true">
52
- <EntitySet Name="flight_dataCollection" EntityType="DEMO_FLIGHT.flight_data" sap:content-version="1" sap:creatable="false" sap:updatable="false" sap:deletable="false"/>
53
- <EntitySet Name="z_demo_flightCollection" EntityType="DEMO_FLIGHT.z_demo_flight" sap:content-version="1" sap:creatable="false" sap:updatable="false" sap:deletable="false"/>
54
- <AssociationSet Name="AssocSet_flight_data_r" Association="DEMO_FLIGHT.flight_data_r" sap:content-version="1" sap:creatable="false" sap:updatable="false" sap:deletable="false">
55
- <End EntitySet="z_demo_flightCollection" Role="FromRole_z_demo_flight_flight_data"/>
56
- <End EntitySet="flight_dataCollection" Role="ToRole_flight_data_z_demo_flight"/>
57
- </AssociationSet>
58
- </EntityContainer>
59
- </Schema>
60
- </edmx:DataServices>
3
+ <edmx:DataServices m:DataServiceVersion="2.0">
4
+ <Schema Namespace="DEMO_FLIGHT" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
5
+ <EntityType Name="flight_data" m:HasStream="false" sap:content-version="1">
6
+ <Key>
7
+ <PropertyRef Name="scheme_id"/>
8
+ <PropertyRef Name="value"/>
9
+ <PropertyRef Name="scheme_agency_id"/>
10
+ </Key>
11
+ <Property Name="scheme_id" Type="Edm.String" Nullable="false" MaxLength="30" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
12
+ <Property Name="airlineid" Type="Edm.String" MaxLength="3" sap:label="Airline" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
13
+ <Property Name="value" Type="Edm.String" Nullable="false" MaxLength="72" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
14
+ <Property Name="scheme_agency_id" Type="Edm.String" Nullable="false" MaxLength="16" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
15
+ </EntityType>
16
+ <EntityType Name="z_demo_flight" m:HasStream="false" sap:content-version="1">
17
+ <Key>
18
+ <PropertyRef Name="scheme_id"/>
19
+ <PropertyRef Name="scheme_agency_id"/>
20
+ <PropertyRef Name="value"/>
21
+ </Key>
22
+ <Property Name="cityto" Type="Edm.String" MaxLength="20" sap:label="Arrival city" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
23
+ <Property Name="scheme_id" Type="Edm.String" Nullable="false" MaxLength="30" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
24
+ <Property Name="curr" Type="Edm.String" MaxLength="5" sap:label="Airline local currency" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
25
+ <Property Name="businmax" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
26
+ <Property Name="arrdate" Type="Edm.DateTime" Precision="8" sap:label="Arrival date" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
27
+ <Property Name="deptime" Type="Edm.Time" Precision="6" sap:label="Departure time" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
28
+ <Property Name="firstmax" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
29
+ <Property Name="price" Type="Edm.Decimal" Precision="23" Scale="4" sap:label="Airfare" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
30
+ <Property Name="businfree" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
31
+ <Property Name="scheme_agency_id" Type="Edm.String" Nullable="false" MaxLength="16" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
32
+ <Property Name="airline" Type="Edm.String" MaxLength="20" sap:label="Airline" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
33
+ <Property Name="economax" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
34
+ <Property Name="cityfrom" Type="Edm.String" MaxLength="20" sap:label="Depart. city" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
35
+ <Property Name="airportfr" Type="Edm.String" MaxLength="3" sap:label="Departure airport" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
36
+ <Property Name="connectid" Type="Edm.String" MaxLength="4" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
37
+ <Property Name="firstfree" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
38
+ <Property Name="econofree" Type="Edm.Int32" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
39
+ <Property Name="airlineid" Type="Edm.String" MaxLength="2" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
40
+ <Property Name="curr_iso" Type="Edm.String" MaxLength="3" sap:label="ISO code" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
41
+ <Property Name="value" Type="Edm.String" Nullable="false" MaxLength="72" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
42
+ <Property Name="flightdate" Type="Edm.DateTime" Nullable="true" Precision="0" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
43
+ <Property Name="airportto" Type="Edm.String" MaxLength="3" sap:label="Destination airport" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
44
+ <Property Name="arrtime" Type="Edm.Time" Precision="6" sap:label="Arrival Time" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
45
+ <NavigationProperty Name="flight_data_r" Relationship="DEMO_FLIGHT.flight_data_r" FromRole="FromRole_z_demo_flight_flight_data" ToRole="ToRole_flight_data_z_demo_flight"/>
46
+ </EntityType>
47
+ <Association Name="flight_data_r" sap:content-version="1">
48
+ <End Type="DEMO_FLIGHT.z_demo_flight" Multiplicity="0..1" Role="FromRole_z_demo_flight_flight_data"/>
49
+ <End Type="DEMO_FLIGHT.flight_data" Multiplicity="0..1" Role="ToRole_flight_data_z_demo_flight"/>
50
+ </Association>
51
+ <EntityContainer Name="DEMO_FLIGHT" m:IsDefaultEntityContainer="true">
52
+ <EntitySet Name="flight_dataCollection" EntityType="DEMO_FLIGHT.flight_data" sap:content-version="1" sap:creatable="false" sap:updatable="false" sap:deletable="false"/>
53
+ <EntitySet Name="z_demo_flightCollection" EntityType="DEMO_FLIGHT.z_demo_flight" sap:content-version="1" sap:creatable="false" sap:updatable="false" sap:deletable="false"/>
54
+ <FunctionImport Name="get_flight" ReturnType="DEMO_FLIGHT.z_demo_flight" EntitySet="z_demo_flightCollection" m:HttpMethod="GET">
55
+ <Parameter Name="id" Type="Edm.Int32"/>
56
+ </FunctionImport>
57
+ <FunctionImport Name="get_top_flight" ReturnType="DEMO_FLIGHT.z_demo_flight" EntitySet="z_demo_flightCollection" m:HttpMethod="GET" />
58
+ <AssociationSet Name="AssocSet_flight_data_r" Association="DEMO_FLIGHT.flight_data_r" sap:content-version="1" sap:creatable="false" sap:updatable="false" sap:deletable="false">
59
+ <End EntitySet="z_demo_flightCollection" Role="FromRole_z_demo_flight_flight_data"/>
60
+ <End EntitySet="flight_dataCollection" Role="ToRole_flight_data_z_demo_flight"/>
61
+ </AssociationSet>
62
+ </EntityContainer>
63
+ </Schema>
64
+ </edmx:DataServices>
61
65
  </edmx:Edmx>
@@ -3,12 +3,13 @@ require 'spec_helper'
3
3
  module OData
4
4
  describe PropertyMetadata do
5
5
  describe "#initialize" do
6
- it "parses an EDMX property with the essentials (name, type, nullable)" do
6
+ it "parses an EDMX property with the essentials (name, type, nullable, nav_prop)" do
7
7
  property_element = RSpecSupport::ElementHelpers.string_to_element('<Property Name="Id" Type="Edm.String" Nullable="false" />')
8
8
  property_metadata = PropertyMetadata.new property_element
9
9
  property_metadata.name.should eq "Id"
10
10
  property_metadata.type.should eq "Edm.String"
11
11
  property_metadata.nullable.should eq false
12
+ property_metadata.nav_prop.should eq false
12
13
  end
13
14
  it "parses an EDMX property where nullable is true" do
14
15
  property_element = RSpecSupport::ElementHelpers.string_to_element('<Property Name="Id" Type="Edm.String" Nullable="true" />')
@@ -36,7 +37,13 @@ module OData
36
37
  property_element = RSpecSupport::ElementHelpers.string_to_element('<Property Name="Title" Type="Edm.String" Nullable="true" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" m:FC_KeepInContent="true" />')
37
38
  property_metadata = PropertyMetadata.new property_element
38
39
  property_metadata.fc_keep_in_content.should eq true
39
- end
40
+ end
41
+ it "parses an EDMX navigation property with the name and the nav_prop set to true" do
42
+ property_element = RSpecSupport::ElementHelpers.string_to_element('<NavigationProperty Name="Category" Relationship="Model.CategoryProduct" FromRole="Product" ToRole="Category" />')
43
+ property_metadata = PropertyMetadata.new property_element
44
+ property_metadata.name.should eq "Category"
45
+ property_metadata.nav_prop.should eq true
46
+ end
40
47
  end
41
48
  end
42
49
  end