流畅的 Nhibernate 和 hbms
作为FNH用户,您是否发现有时需要用hbm文件来补充FNH?您遇到过哪些相对常见的边缘情况(如果有)?
干杯,
贝里尔
As an FNH user, do you find you sometimes need to supplement FNH with an hbm file? Any relatively common edge cases where you do, if so?
Cheers,
Berryl
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您需要使用命名查询,您将需要使用 hbm 文件,并且您可能会使用命名查询来调用存储过程,无论这是因为您有旧的存储过程要调用,可能是性能,还是在我最近的情况下,进行全文搜索。有关设置的更多信息,请参阅此处和此处。
If you need to use named queries you will need to use an hbm file and you would probably use a named query to call a stored procedure whether this be because you have legacy stored procs to call, possibly performance or in my most recent case, to do a full text search. More info on setting this up can be found here and here.
当 Fluent NHibernate 中的错误禁止某些操作时。每个版本的错误较少,但您最终可能会发现一些错误(最近的错误是当存在某些自动映射约定时无法映射字典)
当您有一个遗留系统(使用 hbms 映射)时需要添加新的域对象(使用 fnh 和/或自动映射映射)。
When a bug in Fluent NHibernate prohibits something. There are less bugs each release, but you might find some eventually (the most recent is the inability to map dictionaries when certain auto mapping conventions exist)
When you have a legacy system (mapped using hbms) for which you need to add new domain objects (mapped using fnh and/or automapping).
我在我的(迄今为止唯一一个)NHibernate 项目中使用 FNH Automapping。
起初,我必须编写几个 FNH 重写来解决错误。但 FNH 团队很快就修复了这些错误,并且我能够完全消除覆盖。
从来不需要处理 HBM 文件,我希望它保持这种状态!
I'm using FNH Automapping on my (so far, one and only) NHibernate project.
At first, I had to write a couple of FNH overrides to work around bugs. But the bugs were quickly fixed by the FNH team, and I was able to eliminate the overrides completely.
Never had to deal with the HBM files, and I hope it stays that way!