官术网_书友最值得收藏!

  • Learning NHibernate 4
  • Suhas Chatekar
  • 230字
  • 2021-07-16 13:08:45

Chapter 3. Let's Tell NHibernate About Our Database

You must be excited to start your NHibernate learning tour. Well, we are just about to do that. In this chapter, we are going to talk about declaring mappings for your domain model. You declare mappings to tell NHibernate how classes in your domain model match to database tables. If you have built your database to suit to the domain model then mappings would look very simple. But if database and domain models are not compatible with each other, then mappings start getting complex. Having a thorough knowledge of mappings would help in such situations. There are multiple ways of declaring mappings, from XML-based ones to code-based ones. We will cover three most widely used methods, namely, XML mappings, mapping by code, and fluent mappings.

Mapping is the most important concept in NHibernate. The way NHibernate interacts with database largely depends on how mappings are written. In this chapter, we will cover the basics of mapping. As we go deeper into the other NHibernate features in the upcoming chapters, we would revisit mappings to see how slightly tweaking a mapping can bring about big changes in the way NHibernate interacts with your database. This chapter should give you a basic understanding of how to declare mappings and make you ready for taking the plunge into the more advanced NHibernate topics.

主站蜘蛛池模板: 林芝县| 沙田区| 朝阳县| 柞水县| 新宾| 岚皋县| 琼结县| 陆川县| 林甸县| 崇礼县| 黄陵县| 正安县| 淮滨县| 金平| 江陵县| 微山县| 永靖县| 遂川县| 读书| 乳山市| 安塞县| 措勤县| 南郑县| 福安市| 宾阳县| 北川| 尤溪县| 扎囊县| 盐亭县| 霍城县| 藁城市| 灵丘县| 奉贤区| 平邑县| 灌云县| 和林格尔县| 奇台县| 措勤县| 彰化市| 霍城县| 蕲春县|