如何将NHibernate数据模型映射到领域模型?

发布于 2024-08-11 03:39:07 字数 196 浏览 5 评论 0原文

我开始创建一个域模型,现在我问自己,如何将此域模型映射到 NHibernate 数据模型((使用 Fluent NHibernate)?是否有一个很好且简单的示例来说明如何做到这一点?

对于数据模型,我没有不要考虑物理/关系数据库模型(!)我的意思是数据访问层中的数据模型,所以也许我应该将这个术语更改为数据访问层数据模型?!我希望你们中的一些人可以跟随我^ ^

I started creating a domain model and now I asking myself, how can I map this domain model to a NHibernate Data Model ((using Fluent NHibernate)? Is there anywhere a good and simple example of how to do that?

With Data Model I didn't think about the physical/relational Database Model(!) What I meant was the Data Model in the Data Access Layer. So maybe I should change the term into Data Access Layer Data Model?! I hope some of you can follow me^^

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

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

发布评论

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

评论(4

风吹雪碎 2024-08-18 03:39:07

我会开始阅读 NHibernate 手册,它不是很长,在章节中图 5 涵盖了有关映射中存在的不同选项的许多细节。我发现关于集合映射的第 6 章和关于继承的第 8 章也很重要。

也许您可以从 fluid nhibernate 的入门页面开始,但要了解您将拥有的所有选项在 NH 手册中查找它们的含义,因为 Fluent NHibernate 假定您已经熟悉 XML。

我没有足够的关于 NHibernate in Action 的信息,但是旧的 Hibernate in Action 也很有用,因为 Java 版本的映射示例在大多数情况下在 .NET 上有效,并提供了示例和详细信息每个参数的信息。

I'd start reading the NHibernate manual, it's not very long and in chapter 5 covers many details about the different options that exist in the mappings. I find also important chapter 6 about collection mapping an 8 about inheritance.

Maybe you can start with the getting started page from fluent nhibernate, but to understand all the options you will have to lookup their meaning in the NH manual as Fluent NHibernate assumes that you are already familiar with the XML.

I don't have enough information about NHibernate in Action but the good old Hibernate in Action was also useful because the mapping examples for the Java version are in most cases valid on .NET and provides examples and detailed information on each parameter.

も星光 2024-08-18 03:39:07

这是我遇到过的最简单的逐步入门方法
您的第一个 NHibernate 应用程序 – 第 1 部分

但是,我建议您只需从 Fluent NHibernate 下载区域下载最新的二进制文件,而不是从 Subversion 获取源代码,安装 Ruby 并在您的计算机上本地构建它,但这取决于您。

This is the easiest one for getting started in a step-by-step manner that I have come across
Your very first NHibernate application – Part 1

However, I would recommend that you simply download the latest binaries from the Fluent NHibernate download area rather than getting the source from Subversion, installing Ruby and building it locally on your machine but that's up to you.

任谁 2024-08-18 03:39:07

好吧,您尝试过 www.nhforge.org

Well, have you tried www.nhforge.org and http://fluentnhibernate.org/ ? Both have excellent introductory guides.

旧夏天 2024-08-18 03:39:07

查看 入门 页面/" rel="nofollow noreferrer">流畅的 NHibernate 站点。一定要看看自动映射功能。我在几个小时内就启动并运行了。祝你好运!

Take a look at the Getting started page on the Fluent NHibernate site. And definitely take a look at the Auto Mappings capabilities. I was up and running in a couple of hours. Good luck!

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