是否可以使用 OData 公开来自 Oracle 的数据?
根据我个人的研究,OData 实现似乎很大程度上依赖于 MS Entity 框架。使用开放 ORM(例如 C# 中的 NHibernate 或 Java 中的 Hibernate)来实现 OData 生产者协议似乎是可能的。
在最好的情况下,使用 Oracle 的 OData 协议公开数据会很酷。我对其他开放解决方案持开放态度,例如 Java、JRuby 等。
提前感谢您的宝贵时间。
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.
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.
Thanks in advance for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里有一个教程:WCF Data Services and OData for Oracle Database。
步骤5 关于先决条件有一个下载文件的链接。
There's a tutorial here: WCF Data Services and OData for Oracle Database.
Step 5 on pre-requisites has a link to download the files.
实际上,实体框架只是提供者之一(尽管是最容易上手的提供者)。您绝对可以使用 NHibernate,而且我见过很多人这样做。仍然存在一些黑暗的角落,但在大多数情况下,这都很好。
您还可以编写自己的提供程序(尽管这需要大量工作),为此请参阅 OData 提供程序工具包 http://www.odata.org/developers/odata-sdk。
上周 Oracle 还宣布他们将发布实体框架的官方 Oracle 提供程序,因此您可以使用 EF 作为 OData 提供程序。
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.
实体框架只是公开 OData 的一种解决方案。此解决方案的优点是它是最简单的解决方案。
好消息是实体框架可以与 Oracle 配合使用。正如 Vitek Karas 所写,Oracle 将在今年年底支持实体框架。但您不必等待。还存在其他提供商。例如,请参阅 Devart 和 Data Direct 的产品。
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.
尝试使用面向基于 POCO 的 OData 的“Reflection Provider”。可以轻松地将其映射到任何启用 LINQ 的 ORM - 对于该步骤,我假设您可以将 DbLinq 用于 LINQ-to-Oracle 层。
本文给出了一个示例:
链接
在我自己的发现中,我什至没有使用属性标记,尽管它似乎有帮助这样做。
正如其他地方提到的,您还可以编写完整的自定义提供程序,但考虑到反射提供程序的存在,这似乎是不必要的工作。希望有帮助!
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.
This article gives an example:
Link
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!