NHibernate has at least three different mechanisms for mapping persistent classes to database tables. This is both good and bad. While you can choose the one that you are most comfortable with, this can also leave you confused at times. Two of the mechanisms are natively supported by NHibernate library and one is an external implementation. In this section, we would look at all the three mechanisms briefly, before proceeding to implement mapping for our employee benefits problem. Though there are three different ways of expressing entity mappings, keep in mind that the core of the mapping engine is same, no matter which way you express your mappings. For all the mapping discussions in this chapter, I plan to express mappings using all the three methods in most of the cases. That way you will get a feel of how expressive each method is. It would not harm to stick to one method and ignore the others but remember that XML mappings are most complete...
Learning NHibernate 4
Learning NHibernate 4
Overview of this book
Table of Contents (18 chapters)
Learning NHibernate 4
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Introduction to NHibernate
Let's Build a Simple Application
Let's Tell NHibernate About Our Database
NHibernate Warm-up
Let's Store Some Data into the Database
Let's Retrieve Some Data from the Database
Optimizing the Data Access Layer
Using NHibernate in a Real-world Application
Advanced Data Access Patterns
Working with Legacy Database
A Whirlwind Tour of Other NHibernate Features
Index
Customer Reviews