是否可以使用 OData 从 Oracle 公开数据?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3063684/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to expose data from Oracle using OData?
提问by Michael Rosario
From my personal research, it appears that OData implementations depend extensively on MS Entity framework. It would seem possible to implement the OData producer protocol using an open ORM like NHibernate in C# or Hibernate in Java.
从我个人的研究来看,OData 实现似乎广泛依赖于 MS 实体框架。似乎可以使用开放的 ORM 来实现 OData 生产者协议,例如 C# 中的 NHibernate 或 Java 中的 Hibernate。
In the best of all worlds, it would be cool to expose data using OData protocol from Oracle. I am open to other open solutions like Java, JRuby, etc.
在最好的情况下,使用 Oracle 的 OData 协议公开数据会很酷。我对 Java、JRuby 等其他开放解决方案持开放态度。
Thanks in advance for your time.
在此先感谢您的时间。
采纳答案by Vitek Karas MSFT
Actually Entity Framework is just one of the providers (although the easiest one to start with). You can definitely use NHibernate and I've seen lot of people do that. There are still some dark corners, but for the most part this works just fine. You can also write your own provider (which is lot of work though), for this see the OData Provider Toolkist at http://www.odata.org/developers/odata-sdk. Last week Oracle also announced that they will release an official Oracle provider for Entity Framework, so using that you can use the EF as the OData provider.
实际上实体框架只是提供者之一(尽管最容易开始)。您绝对可以使用 NHibernate,而且我已经看到很多人这样做了。仍然有一些黑暗的角落,但在大多数情况下,这很好用。您也可以编写自己的提供程序(虽然工作量很大),为此请参阅http://www.odata.org/developers/odata-sdk 上的 OData Provider Toolkist 。上周 Oracle 还宣布他们将发布实体框架的官方 Oracle 提供程序,因此您可以使用 EF 作为 OData 提供程序。
回答by Kirk Kuykendall
There's a tutorial here: WCF Data Services and OData for Oracle Database.
这里有一个教程:用于 Oracle 数据库的 WCF 数据服务和 OData。
Step 5 on pre-requisites has a link to download the files.
先决条件的第 5 步有一个下载文件的链接。
回答by Fabrice
Entity Framework is just one solution for exposing OData. The advantage of this solution is that it's the easiest one.
The good news is that Entity Framework works with Oracle. As Vitek Karas wrote, Oracle will support Entity Framework by then end of the year. But you don't have to wait. Other providers exist. See the products from Devart and Data Direct, for example.
实体框架只是公开 OData 的一种解决方案。这种解决方案的优点是它是最简单的。
好消息是 Entity Framework 可以与 Oracle 一起使用。正如 Vitek Karas 所写,甲骨文将在年底前支持实体框架。但你不必等待。存在其他提供者。例如,请参阅来自 Devart 和 Data Direct 的产品。
回答by Malachi
Try using the "Reflection Provider" which is geared towards POCO-based OData. It's easy to map this to any LINQ-enabled ORM - for that step I assume you could use DbLinq for your LINQ-to-Oracle layer.
尝试使用面向基于 POCO 的 OData 的“反射提供程序”。很容易将它映射到任何支持 LINQ 的 ORM - 对于这一步,我假设您可以将 DbLinq 用于您的 LINQ-to-Oracle 层。
This article gives an example:
这篇文章举了一个例子:
In my own findings I didn't even use the attribute markup, though it seems helpful to do so.
在我自己的发现中,我什至没有使用属性标记,尽管这样做似乎很有帮助。
As alluded to elsewhere you can also write a complete custom provider, but that seems like unnecessary work given the existence of the reflection provider. Hope it helps!
正如其他地方所提到的,您也可以编写一个完整的自定义提供程序,但鉴于反射提供程序的存在,这似乎是不必要的工作。希望能帮助到你!