NHibernate3 anatomy: Mapping's Conform Combat (1): Overview

Source: Internet
Author: User
<span id="Label3"></p>Orum thought emerges<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">We are so familiar with Orm (object relational Mapping), But we can imagine the idea of Orum (object relational Un-mapping) from another angle. We only define domain in the program, and we want to have a tool that can help us "automate" the implementation of mapping, and we don't need to manually code mapping for domain as traditional ORM Thought.</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">Orum is more like the meaning of Oram (object-relational Auto-mapping) or Orim (object-relational Intelligent-mapping) for the User.</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">Is there such an implementation? The answer is quite certain.</p></p>Conform overview<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">conform, a nhibernate contributor Fabio maulo, is a tool for configuring orm, and its interface is defined by the ORM concept, based on the GNU Lesser general Public License Protocol. The source of design thought is orum (Object relational un-mapping). It helps us "automatically" implement mapping according to the domain Definition. Now only the "automatic" Mapping is implemented for nhibernate, and if you are interested, you can add automatic Mapping functionality to ef.</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">So how is conform "automatic"?</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">NHibernate to the mapping process, is to deserialize the XML file into Hbmmapping class, and then the Hbmmapping class bind mappings, finally bind Sessionfactory. The conform is the automatic generation of the Hbmmapping class using the domain definition implementation, completely avoiding the writing of XML files and Deserialization. In this way, conform is playing the role of Orawm "object to relational <del>adapter</del> without mappings".</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">You can get conform from http://code.google.com/p/codeconform/.</p></p>Conform Preliminary interview<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">This is the first article in this series, we use a simple example to realize it, and then slowly introduce its details. First we write down the NHibernate base code and common code, This step of the code in future articles are also used frequently, and later will not be posted separately.</p></p><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><span class="notranslate"><span style="color:green"><span style="color:green">//code Snippets Copyright http://lyj.cnblogs.com/</span></span><span style="color:blue">public <span style="color:blue">Static Class</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Nhconfig</span></span>{<span style="color:blue"><span style="color:blue">Private Const string</span></span>ConnectionString =<span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">@ "Data source=.\sqlexpress;initial catalog=nhtest;integrated security=true; Pooling=false "</span></span>;<span style="color:blue">public <span style="color:blue">Static</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Configuration</span></span>Configurenhibernate () {<span style="color:blue"><span style="color:blue">var</span></span>Configure =<span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Configuration</span></span>(); Configure. Sessionfactoryname (<span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">"Demo"</span></span>); Configure. Proxy (p = p.proxyfactoryfactory<<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">proxyfactoryfactory</span></span>> ()); Configure. Databaseintegration (db = {db). dialect<<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Mssql2008dialect</span></span>> (); Db. driver<<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Sqlclientdriver</span></span>> (); Db. ConnectionString = ConnectionString; Db. Logsqlinconsole =<span style="color:blue"><span style="color:blue">true</span></span>;<span style="color:green"><span style="color:green">//for displaying output SQL</span></span>});<span style="color:blue"><span style="color:blue">return</span></span>Configure }<span style="color:blue">public <span style="color:blue">static string</span></span>Serialize (<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">hbmmapping</span></span>Hbmelement) {<span style="color:blue"><span style="color:blue">var</span></span>setting =<span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">xmlwritersettings</span></span>{Indent =<span style="color:blue"><span style="color:blue">true</span></span>};<span style="color:blue"><span style="color:blue">var</span></span>Serializer =<span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">XmlSerializer</span></span>(<span style="color:blue"><span style="color:blue">typeof</span></span>(<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">hbmmapping</span></span>));<span style="color:blue"><span style="color:blue">using</span></span>(<span style="color:blue"><span style="color:blue">var</span></span>Memstream =<span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">MemoryStream</span></span>(2048))<span style="color:blue"><span style="color:blue">using</span></span>(<span style="color:blue"><span style="color:blue">var</span></span>XmlWriter =<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">XmlWriter</span></span>. Create (memstream, setting)) {serializer. Serialize (xmlWriter, hbmelement); Memstream.flush (); Memstream.position = 0;<span style="color:blue"><span style="color:blue">var</span></span>SR =<span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">StreamReader</span></span>(memstream);<span style="color:blue"><span style="color:blue">return</span></span>Sr. ReadToEnd (); } }}</span></pre><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">The Configurenhibernate () method is used to configure the Nhibernate,serialize method for Output. Let's start the conform tour:</p></p>1. Define a domain<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">The beginning of the journey, we always from the simplest to start, in the future to learn conform in the end how "automatic" for our complex domain structure generated mapping.</p></p><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><span class="notranslate"><span style="color:green">//Code Snippets Copyright http://lyj.cnblogs.com/</span><span style="color:blue"></span><span style="color:rgb(43,145,175)">Domain</span>{ <span style="color:blue"></span><span style="color:blue">get</span><span style="color:blue">set</span>; } <span style="color:blue"></span><span style="color:blue">get</span><span style="color:blue">set</span>; }}</span></pre></pre>2.ConfORM Configuration<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; Color:rgb (51,51,51); font-family:georgia, ' Times New Roman ', times,sans-serif; FONT-SIZE:14PX "> This step is very important, is the core of conform, instantiate a objectrelationalmapper object, assemble the domain object, instantiate the mapper object, Call the Compilemappingfor () method of the Mapper object to generate the Hbmmapping automatically. </p></p><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><span class="notranslate"><span class="notranslate"><span style="color:green">//Code Snippets Copyright http://lyj.cnblogs.com/</span><span style="color:blue">public static </span><span style="color:rgb(43,145,175)">HbmMapping </span>GetMapping(){ <span style="color:blue">var </span>orm = <span style="color:blue">new </span><span style="color:rgb(43,145,175)">ObjectRelationalMapper</span>(); orm.TablePerClass<<span style="color:rgb(43,145,175)">Domain</span>>(); <span style="color:blue">var </span>mapper = <span style="color:blue">new </span><span style="color:rgb(43,145,175)">Mapper</span>(orm); <span style="color:blue">return </span>mapper.CompileMappingFor(<span style="color:blue">new</span>[] { <span style="color:blue">typeof</span>(<span style="color:rgb(43,145,175)">Domain</span>) });}</span></span></pre>3.ConfORM Tour<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">The key to this step is to call the Adddeserializedmapping () method of the Configuration object to add the hbmmapping and configuration Metadata.</p></p><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><span class="notranslate"><span style="color:green"><span style="color:green">//code Snippets Copyright http://lyj.cnblogs.com/</span></span><span style="color:blue">public <span style="color:blue">static void</span></span>Justforconform () {<span style="color:green"><span style="color:green">//configuration NHibernate</span></span><span style="color:blue"><span style="color:blue">var</span></span>conf =<span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Nhconfig</span></span>. Configurenhibernate ();<span style="color:green"><span style="color:green">//add hbmmapping to the configuration</span></span>Conf. Adddeserializedmapping (getmapping (),<span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">"Domain"</span></span>);<span style="color:green"><span style="color:green">//configure Meta-data</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Schemametadataupdater</span></span>. Quotetableandcolumns (conf);<span style="color:green"><span style="color:green">//create Database Schema</span></span><span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Schemaexport</span></span>(conf). Create (<span style="color:blue"><span style="color:blue">false</span></span>,<span style="color:blue"><span style="color:blue">true</span></span>);<span style="color:green"><span style="color:green">//establish sessionfactory</span></span><span style="color:blue"><span style="color:blue">var</span></span>Factory = Conf. Buildsessionfactory ();<span style="color:green"><span style="color:green">//open session to make persistent data</span></span><span style="color:blue"><span style="color:blue">using</span></span>(<span style="color:blue"><span style="color:blue">var</span></span>s = factory. Opensession ()) {<span style="color:blue"><span style="color:blue">using</span></span>(<span style="color:blue"><span style="color:blue">var</span></span>tx = S.begintransaction ()) {<span style="color:blue"><span style="color:blue">var</span></span>Domain =<span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Domain</span></span>{Name =<span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">"my tests"</span></span>}; S.save (domain); Tx.commit (); } }<span style="color:green"><span style="color:green">//open session to delete data</span></span><span style="color:blue"><span style="color:blue">using</span></span>(<span style="color:blue"><span style="color:blue">var</span></span>s = factory. Opensession ()) {<span style="color:blue"><span style="color:blue">using</span></span>(<span style="color:blue"><span style="color:blue">var</span></span>tx = S.begintransaction ()) {s.createquery (<span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">"delete from Domain"</span></span>). Executeupdate (); Tx.commit (); } }<span style="color:green"><span style="color:green">//delete Database Schema</span></span><span style="color:blue"><span style="color:blue">New</span></span><span style="color:rgb(43,145,175)"><span style="color:rgb(43,145,175)">Schemaexport</span></span>(conf). Drop (<span style="color:blue"><span style="color:blue">false</span></span>,<span style="color:blue"><span style="color:blue">true</span></span>);}</span></pre>4. Output XML<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">okay, done the above 3 steps to complete our test: nhibernate automatically create a database schema, persist data, Delete data, and finally delete the database Schema. At this time everyone has a question, conform automatically generated hbmmapping is what ah? What exactly does the serialized Hbmmapping object output? In order to meet the needs of everyone we write a code to let conform print out xml, against our previous handwritten *.hbm.xml file to see if it matches:</p></p><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; Border-color:silver Silver Silver RGB (108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:consolas, ' Courier New ', song body, courier,mono,serif; Color:rgb (51,51,51); Background-color:rgb (255,255,255) "><span class=" notranslate "><span style=" color:green ">//Code Snippets Copyright http://lyj.cnblogs.com/</span> <span style="color:blue">public static void </span> showxmlmapping () {<span style=" Color:blue ">var </span> document = <span style=" color:rgb (43,145,175) ">nhconfig </span>. Serialize (getmapping ()); <span style="color:rgb (43,145,175)">file </span>. WriteAllText (<span style="color:rgb (163,21,21)"> "MyMapping.hbm.xml" </span>, document); <span style="color:rgb (43,145,175)">console </span>. Write (document);} </span> </pre></pre><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">At this point, we open the output directory of the MyMapping.hbm.xml file to see the content:</p></p><pre class="code" style="margin-top:0px; margin-bottom:0px; white-space:pre-wrap; word-wrap:break-word; line-height:16px; border-color:silver silver silver rgb(108,226,108); border-width:1px 1px 1px 5px; border-style:solid; padding:8px; font-family:Consolas,‘Courier New‘,宋体,Courier,mono,serif; color:rgb(51,51,51); background-color:rgb(255,255,255)"><span class="notranslate"><span style="color:green"><span style="color:green">//code Snippets Copyright http://lyj.cnblogs.com/</span></span><span style="color:blue"><span style="color:blue"><?</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">XML</span></span><span style="color:red"><span style="color:red">version</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">1.0</span></span>"<span style="color:red"><span style="color:red">encoding</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Utf-8</span></span>"<span style="color:blue"><span style="color:blue">?><</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">hibernate-mapping</span></span><span style="color:red"><span style="color:red">Xmlns:xsi</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">http://www.w3.org/2001/XMLSchema-instance</span></span>"<span style="color:red"><span style="color:red">xmlns:xsd</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Http://www.w3.org/2001/XMLSchema</span></span>"<span style="color:red"><span style="color:red">namespace</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Yjinglee.conform</span></span>"<span style="color:red"><span style="color:red">Assembly</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Yjinglee.conform</span></span>"<span style="color:red"><span style="color:red">xmlns</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">urn:nhibernate-mapping-2.2</span></span>"<span style="color:blue"><span style="color:blue">> <</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">class</span></span><span style="color:red"><span style="color:red">name</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Domain</span></span>"<span style="color:blue"><span style="color:blue">> <</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">ID</span></span><span style="color:red"><span style="color:red">name</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Id</span></span>"<span style="color:red"><span style="color:red">type</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Int32</span></span>"<span style="color:blue"><span style="color:blue">> <</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">Generator</span></span><span style="color:red"><span style="color:red">class</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Hilo</span></span>"<span style="color:blue"><span style="color:blue">/> </</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">ID</span></span><span style="color:blue"><span style="color:blue">> <</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)"></span> property</span><span style="color:red"><span style="color:red">name</span></span><span style="color:blue"><span style="color:blue">=</span></span>"<span style="color:blue"><span style="color:blue">Name</span></span>"<span style="color:blue"><span style="color:blue">/> </</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">class</span></span><span style="color:blue"><span style="color:blue">></</span></span><span style="color:rgb(163,21,21)"><span style="color:rgb(163,21,21)">hibernate-mapping</span></span><span style="color:blue"><span style="color:blue">></span></span></span></pre><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">well, The handwriting is exactly the same, conform can be aware of the members of the domain class, the ID primary key uses the Hilo build policy, and name is the Property. hey, is it just the way it is generated? The answer is of course not, conform offers a lot of patterns and customizations, which are introduced in the Future.</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">Just use the next few lines of code to complete the automatic mapping function, is not very cool, after reading this article, you are not very eager to follow me to learn the next conform, and then try to focus on the old program, and throw away Hibernate.cfg.xml and *.hbm.xml files Ah.</p></p>Conclusion<p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">This article first with everyone into the conform, the details of the next slowly introduced, we have what problems and thinking can be answered.</p></p><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px"><p style="line-height:25.2000007629395px; margin:10px auto; color:rgb(51,51,51); font-family:Georgia,‘Times New Roman‘,Times,sans-serif; font-size:14px">Attach source code download: YJingLee.TryConfOrm.zip (VS2010 Project)</p></p> <p style="font-size:12px;"><p style="font-size:12px;">Copyright Notice: This article for Bo Master http://www.zuiniusn.com original article, without Bo Master permission not Reproduced.</p></p> <p><p>NHibernate3 anatomy: Mapping's Conform Combat (1): Overview</p></p></span>

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.