2. Configure nhib.pdf

Source: Internet
Author: User

2. Configure nhib.pdf

 

[Most of the text in this article is reproduced on multiple networks for learning purposes only. Please contact: binglingshui (a) gmail.com.]

 

 

2.1 configuration file description

ORM (object relational mapping, object/link ing)It is used to map between relational databases and objects. In this way, we do not need to deal with complex SQL statements when operating the database, you only need to operate on an object as usual.

Object Relational ing, the core of which is to complete two functions: the ing rules between objects and relational databases, and the mutual conversion between the two.
In addition to these two basic functions, General o/R mapping products will also add some additional features and functions to enhance product functions, it provides more convenience and performance improvement for software development. Some common functions, such as caching.
There are some typical o/R Mapping frameworks available for reference and use. The well-known ones are entity beans, JDO, and hibernate in ejbs. These solutions are based on Java. In Microsoft. NET
There are few options available, including nhib.pdf.

......

 

2.2 configuration file example in WEB Project

 

Add the Nhibernate sections configuration Node

 

Code
< Configsections >
<! -- Nhib1_section -->
< Section Name = "Hibernate-configuration" Type = "Nhibernate. cfg. configurationsectionhandler, nhibler"   />
</ Configsections >

 

 

 ConfigureDatabase ConnectionDetails

Nhib1_configuration
<! -- Nhib1_configuration -->
< Hibernate-Configuration Xmlns = "Urn: nhibernate-configuration-2.2" >
< Session-factory >
< Property Name = "Connection. provider" > Nhib.pdf. Connection. driverconnectionprovider </ Property >
< Property Name = "Dialect" > Nhib.pdf. dialect. mssql2005dialect </ Property >
< Property Name = "Connection. driver_class" > Nhib.pdf. Driver. sqlclientdriver </ Property >
< Property Name = "Connection. connection_string" >
Data Source =. \ sqlexpress; Integrated Security = sspi; attachdbfilename = | datadirectory | \ dinnertime. MDF; user instance = true
</ Property >
< Mapping Assembly = "Dinnertime. Model" />
</ Session-factory >
</ Hibernate-Configuration >

 

2.2 configuration file example

 

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.