Introduced
In the previous article, we introduced the view, solicit your comments, and I'll probably use three pages to cover the entire detailed process of how to use the stored procedure in NHibernate, which is all experience accumulated in practice, involving the error information just used, how to modify the stored procedure, and compare not to use the different points of stored procedures, and unofficial comparison of authoritative information,
, Hbmmapping can be parsed directly, we can choose not to use XML file mapping.Mapping partFabio Maulo completely reconstructed the NHibernate.Cfg.MappingSchema section, improved performance, and Fabio Maulo designed a configuration ORM tool--conform, to help us "automatically" implement mapping, of course, Conform is not part of nhibernate, we need to download separately.Query sectionIn the
The content of this section
What is concurrency control?
Pessimistic concurrency control (pessimistic Concurrency)
Optimistic concurrency control (optimistic Concurrency)
NHibernate supports optimistic concurrency control
Example analysis
Conclusion
What is concurrency control?When many people try to modify data in a database at the same time, a control system must be implemented so that changes made by
The content of this section
Transaction overview
1. New Object
"Test submitted successfully"
"Test failed Rollback"
2. Deleting objects
3. Updating objects
4. Save the updated object
Conclusion
In the previous article we introduced the INSERT, Update, delete operation in NHibernate, which we look at in NHibernate. You can commit or roll back your acti
NHibernate is the most popular ported version of the Java O/R mapping Framework Hibernate, and the current version is 1.0.2. It was born in Sf.net..ibatisnet is another excellent Java O/R mapping framework, the current version is 1.2. Currently belongs to Apache one of the sub-projects.Relative to the NHibernate " O/R", Ibatisnet is a " Sql Mapping" The ORM
NHibernate building an ASP. NET MVC application what is NHibernate?NHibernate is an object/relational database mapping tool for the. NET environment. The term object/relational database mapping (Object/relational mapping,orm) represents a technique used to map objects represented by object models to SQL-based relationa
The contents of this section
Start using NHibernate
1. Get NHibernate
2. Create DATABASE tables
3. Create a C # class library project
4. Writing the Domainmodel layer
4-1. Preparation of the persistence class
4-2. Write the mapping file
5. Write Data Access Layer
5-1. Auxiliary class
5-2. Write operation
6. Write test for data access layer
6-1. Configure NHi
start,end
1
);
Combine
Programmability (Syntax support)
Fault tolerance
Development efficiency
Correlation Query Support Degree
Additional configuration
Cache support
Nhibernate
LINQLAMBDA syntax
High
In
In
mapping requires configuration XML
Support
Entity Framework
also need to be considered, such as NHibernate and Nbear must first be configured to cache, simple values can not tolerateCodefirst Or DbfirstAlso mentioned above, EF7 forced the Codefirst model, the development concept to change, first business data, data is based on business implementation, ideallyWhat kind of business structure, should have what kind of data table structure, should not go to tube database what kind of, by the framework to deal wit
Http://www.cnblogs.com/lyj/archive/2008/11/28/1343418.htmlYou can define a named query in a mapping file The,Define a query named Selectcustomer in the Customer.hbm.xml mapping file because the cache mode is the default by querying all the Customer and enabling cache queries (described below)"true" cache-mode="normal"name= " Selectcustomer " > from CustomerWrite a method:[Test] Public voidnamedquerycachetest () {using(_session) {Console.WriteLine ("---> Use named queries for the first time");
will be accompanied by the creation and destruction of the session's life cycle;3. The session cache is an entity-level cache, which is used only when querying the object level, and does not use the first-level cache if you use HQL and SQL are query attribute levels! Remember!!!! 4. Understand the difference between get () and load () in the first level cacheUse the Isession.get () method to immediately save the object instance to the cache.Using the Isession.load () method only loads the ID of
The contents of this section
What is concurrency control?
Pessimistic concurrency control (pessimistic concurrency)
Optimistic concurrency control (optimistic concurrency)
NHibernate Support optimistic concurrency control
Example analysis
Conclusion
What is concurrency control?
When many people try to modify the data in the database at the same time, a control system must be implemented so that changes made by one person do not adversely affec
The contents of this section
Introduced
1. Persistence class
2. Mapping file
3. Test
Conclusion
Introduced
In database operations, in addition to table operations, as well as views, stored procedures, and other operations, this article and the next article to learn about these things. In this article we'll learn how to use views in nhibernate. First, we set up a database named Viewcustomer view, select CustomerID, Firstname, Lastname, OrderId,
If you have ever used NHibernate 2.0 or higher, you must have encountered the following error: NHibernate.InvalidProxyTypeException:The Following types May is used as proxies:NHibernateExamples.Entities.OrderLine:method get_unitprice should be ' public/protected virtual ' or ' protected internal VirtualNHibernateExamples.Entities.OrderLine:method set_unitprice should be ' public/protected virtual ' or ' protected internal VirtualGee, we forgot to mark
OverviewThere is a need to manage enterprise intranet information, including icons and links. Consider that the icon is not very large, so the picture is saved directly in the database.But with NHibernate, how do you map it?Table 5.5. Large Object Mapping Types
NHibernate Type
. NET Type
Database Type
Remarks
Stringclob
System.St
Turn from: http://www.dotnetjalps.com/2013/09/asp-net-mvc-nhibernate-crud-getting-started.html
In this post we are going to learn how we can use the NHibernate in asp.net MVC application. What is NHibernate: Orms (Object relational Mapper) are quite popular this. ORM is a mechanism to map database entities to Class en
The. Net ORM Mapping Framework NHibernate, originally a Java thing, a herd of cow b roaring yards, transplanted to the. NET platform, is a very good ORM mapping framework,The story begins, ~_~!The bell of the work was ringing, and looked away from afar. Punch line, the long queue, Punch machine, "du" "Du" "du" ...Bear: Bald head strong, parcel data pushed past it
(The following is mainly used for their own life records, do not like to spray)From work to now also more than a year, but last Friday, the old shouted at me, asked me a sentence: "I'm going to let you help me find some information on the weekend, you know ORM?" ”At that time, I was directly stunned, because at that time I completely did not understand the ORM of the concepts of the concept of a few words (
Original address:
Http://www.cnblogs.com/lukun/archive/2011/05/16/2047587.html
It's a nice piece of writing.
The memory of the Lost YouthSource: http://www.cnblogs.com/lukun/This article copyright to the author and blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph of the statement, and in the article page obvious location to the original connection, if there is a problem, you can contact me through http://www.cnblogs.com/lukun/, thank you very much.
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.