是否有像 iBATIS.NET 一样的查询映射器,但具有脏跟踪、延迟加载和级联更新功能?

发布于 2024-08-20 08:09:57 字数 788 浏览 6 评论 0原文

问题:

  1. DBA 控制的数据库具有仅存储过程的授权。
  2. 期望在 POCO 中定义域。

因此,我决定需要一个专为存储过程和/或遗留数据库设计的 ORM。

理想情况下,ORM 应该允许我以声明方式(或流畅地)将域对象映射到 CRUD 存储过程。

到目前为止的一些发现:

  1. 只要我能够控制为延迟加载生成的查询,NHibernate 就会起作用。
  2. iBATIS.NET 可以完美工作,但我找不到任何示例:
    1. 对象状态跟踪(新/更新/删除/等)
    2. 父/子提交事务(如果更新了父对象,则也更新所有脏子对象)。
  3. 内部开发的与我们的数据库约定兼容的 ORM 是一种选择,我们已经开始使用它。但我想确保我们没有其他选择。

非选项:

  1. SubSonic 确实包装存储过程,但它不在过程和实体之间映射。如果需要的话,我可以实现某种映射器,但还有其他因素对 SubSonic 不利,例如缺乏 VS2005(或 SharpDevelop)支持以及将数据访问与域对象混合在一起。
  2. 删除 SProcs 不是一个选项。数据完整性是 DBA 和高层非常关心的问题,他们觉得 SPprocs 是最安全的。我无权说服他们。

有谁知道适合我的需求的 ORM,或者或者克服 100% 不适合我的需求的 ORM 的限制的方法

欢迎任何建议!

The problem:

  1. A DBA-controlled database with a Stored Procedure-only mandate.
  2. An expectation that the domain be defined in POCO's.

So I decided that I need an ORM designed for stored procedures and/or legacy databases.

Ideally the ORM should allow me to declaratively (or fluently) map domain objects to CRUD stored procedures.

Some findings thus far:

  1. NHibernate would work if only I could control the queries that are generated for lazy-loading.
  2. iBATIS.NET would work perfectly, but I can't find any examples of:
    1. object state tracking (new/updated/deleted/etc)
    2. parent/child commit transactions (if a parent is updated, update all dirty child objects as well).
  3. An In-House developed ORM that works with our database conventions is an option and we have already started with this. But I want to make sure we don't have any other choice.

Non-Options:

  1. SubSonic does wrap stored procs, but it doesn't map between procs and entities. I could implement a mapper of some sort if it came to it, but there are other factors also weighting against SubSonic, such as lacking VS2005 (or SharpDevelop) support and mingling data-access with domain objects.
  2. Dropping the SProcs is not an option. Data integrity is a HUGE concern for the DBA's and the higher-ups and they feel safest with SProcs. It's not my place to convince them otherwise.

Does anyone know of an ORM that suits my needs, or a way to overcome the limitations in an ORM that doesn't suit my needs 100%?

Any suggestions welcome!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情深已缘浅 2024-08-27 08:09:57

我认为 NHibernate 是你最好的选择。

您可以使用 loader、sql-insert、sql-delete、sql-update 元素来配置实体和延迟加载集合的存储过程,尽管这意味着相当多的击键。

I think NHibernate is your best bet.

You can use loader, sql-insert, sql-delete, sql-update elements to configure store procs for entities and lazy load collections, although it means quite a lot of keystrokes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文