Simple NHibernate learning notes and nhibernate learning notes
Nhib.pdf Is An ORM framework on the. NET platform. It interacts with the project system in the same way as ADO. NET.
1. First of all to use the nhib.pdf framework to have a third-party dll library as support, attached Baidu cloud :( link: http://pan.baidu.com/s/1dD2KRvz password: 50fb)
2. Create a new class library project to introduce the dll file in the nhib.pdf Library:
Create a question class People. cs:
Note that the virtual keyword must be added for each attribute.
Then configure a ing file named people. hbm. xml for the object class. This file should change the generate operation in the attribute to the embedded resource.
3. Create a test project
In the bin directory of the test project, you need to configure a global ing file named NHibernate and the database and the current class: hibernate. cfg. xml
Note that you must pay attention to the version of your database When configuring the dialect attribute.
4. Finally, call (note the HQL statement of the nhib.pdf query language. This test program is a console application)