是否流利,NHibernate的支持映射程序? [英] Does Fluent-NHibernate support mapping to procedures?

查看:153
本文介绍了是否流利,NHibernate的支持映射程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在想,如果有可能有流利,NHibernate的使用已经存在并指定从结果设置为我自己的域对象的映射存储过程沟通。

I've been wondering if it's possible to have Fluent-NHibernate communicate with stored procedures that already exist and assign mapping from the result set to my own domain objects.

也就是流利,NHibernate的能够直接执行没有结果集返回程序?

Also is Fluent-NHibernate able to directly execute procedures with no result set returned?

基本上,我一直在考虑使用流利,NHibernate的更换陈旧TypedDataSet的影响模型与领域驱动设计,可以从DAL返回简单对象。如果流利,NHibernate的不能与SP的工作轻松,我想我会最likley有一个组合DAL同时使复杂的程序由企业库进行管理,将充分利用FNH的简单CRUD操作。虽然我不认为这将是最佳的有2个竞争DALS如果FNH无法与SP的踢好我很乐意听到任何其他的想法不是同时使用EntLib和FNH在一起。

Basically I've been considering the implications of using Fluent-NHibernate to replace a dated TypedDataSet model with a domain driven design that can return simple objects from the DAL. If Fluent-NHibernate cannot work with SPs easily, I think I would most likley have a combinational DAL that will take advantage of FNH for simple CRUD operations while leaving complex procedures to be managed by Enterprise Library. While I don't think it would be optimal to have 2 competing DALs if FNH cannot play well with SPs I'd love to hear any other ideas than using both EntLib and FNH together.

推荐答案

功能NHibernate(在GitHub上)的主干版本支持插入,更新和删除存储过程。

The trunk version of Fluent NHibernate (on GitHub) supports insert, update and delete stored procedures.

在您的映射类的构造函数,调用:

In your mapping class constructor, call:

SqlInsert("StoredProcName");



免责声明:我没有测试此我自己还,但它肯定会很快派上用场

Disclaimer: I haven't tested this myself yet, but it certainly will come in handy soon.

有关详细信息请参见这个线程在功能NHibernate谷歌集团。

For more info see this thread in the Fluent NHibernate Google Group.

这篇关于是否流利,NHibernate的支持映射程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆