Simple NHibernate learning notes and nhibernate learning notes

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.