如果我必须为 Oracle .net Entity Framework 定义 app.config 中的每个字段,那么 ORM 的意义何在?
据我所知,实体框架的重点是简化和统一数据访问模型。
我下载了最新的 Oracle .net 工具(ODAC 11.2 第 4 版),该工具声称支持 EF4,并且我正在尝试导入一些 Oracle 存储过程(通过函数导入),该过程将一个引用游标作为输出参数。 当我阅读 Oracle 网站
它说我必须在 app.config 中定义引用游标返回的每个字段。 出色地。这是非常愚蠢的,并且使得整个实体框架对于 Oracle 来说毫无用处。
我错过了什么吗?
To my knowledge, the whole point of Entity framework is to simplify and unify data access models.
I downloaded latest Oracle's .net tools (ODAC 11.2 Release 4) which claims EF4 support, and I'm trying to import some Oracle stored procedure (through function import) that has one ref cursor as output param.
When I read the documentation on Oracle's site
It says that I have to define each field returned by the ref cursor in my app.config.
Well. That's extremely stupid and makes the whole Entity framework useless for Oracle.
Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
理论上是的。实际上,MS 的目标是 MS 工具 = 它们仅支持 SQL Server 和 SQL Server CE 功能。如果其他数据库提供了一些特殊的附加功能,那么它们要么在 EF 中不可用,要么必须以某种方式侵入。
这就是此类功能的示例。我不知道从 SQL Server 中的存储过程返回数据库游标的可能性,并且 EF 确实不支持这一点。
但这不是 EF 的问题,而是 Oracle 如何构建 API 来使用它的问题。恕我直言,整个游标以某种方式被 ODP.NET 隐藏,并将正常结果集传递给 EF。游标结果的映射在配置中描述。
In theory yes. In practice MS targets MS tools = they work only on support of SQL server and SQL Server CE features. If other databases provide some special additional features they are either not available in EF or must be somehow hacked in.
That is the example of such feature. I don't know about possibility of returning database cursor from stored procedure in SQL server and EF really doesn't support that.
But that is not problem of EF but of the way how Oracle build the API to use it. IMHO the whole cursor is somehow hidden by ODP.NET and it pass normal result set to EF. The mapping of cursor result is described in configuration.
我100%同意你的观点。 Oracle 的 EF 实现非常缺乏。这种映射很愚蠢,容易出错,维护起来也是噩梦。至少 Oracle 应该提供一个生成器工具来对 SP 代码进行逆向工程并创建映射。即使完美的映射不可能,这也将是一个开始。此外,它不支持函数,并且我们的 Oracle 标准尽可能支持函数而不是 SP。返回多个引用也是不可能的。
I agree with you 100%. Oracle's EF implementation is highly lacking. The mapping is stupid, error prone and nightmare to maintain. At the very least Oracle should have provided a generator tool that reverse engineers the SP code and create a mapping. Even if perfect mapping is not possible it would be a start. Also it doesn't support functions and our Oracle standard favours functions over SPs wherever possible. Returning multiple refcursors are also not possible.