<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>NHibernate blog</title><link>http://nhforge.org/blogs/nhibernate/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/NHibernateBlog" type="application/rss+xml" /><item><title>DataBase; The Eliot Ness of IT ?</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/gT2UuL8O-Ec/database-the-eliot-ness-of-it.aspx</link><pubDate>Fri, 26 Jun 2009 13:23:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:393</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=393</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/26/database-the-eliot-ness-of-it.aspx#comments</comments><description>&lt;p&gt;[&lt;a target="_blank" href="http://fabiomaulo.blogspot.com/"&gt;My blog&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;How many times we heard : &lt;/p&gt;
&lt;p&gt;&amp;ldquo;I need to map this situation&amp;hellip;bla&amp;hellip;bla&amp;hellip; Note: I can&amp;rsquo;t touch the DataBase schema.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I don&amp;rsquo;t like composite PK but I can&amp;rsquo;t change the DB schema.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I need to map this situation&amp;hellip;bla&amp;hellip;bla&amp;hellip; Note: legacy DB.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;You can see phrases similar to those above in various NHibernate forums in various languages. The fact that questions are sent to a NH&amp;rsquo;s forum mean that somebody are developing a new .NET2.0 or .NET3.5 application using NHibernate with an existing DataBase (I&amp;rsquo;m hoping this is the only possible situation). If a company spent time and money to rewrite an obsolete application for sure is because it is needed.&lt;/p&gt;
&lt;p&gt;Let me show another situation: In a new application the first base module was deployed in production. The team now has an existing application with an existing DB and is developing another module. In the second module we realize that some change is needed to the persistence we actually have in production. What the team should do ? Well&amp;hellip;something normal for us is create a &amp;ldquo;migration step&amp;rdquo; for the DB. The same happen again and again in each sprint.&lt;/p&gt;
&lt;p&gt;How much different is the situation when the existing DB is five, or more, years old ? (well&amp;hellip; it is different but I&amp;rsquo;m not so sure that the difference is so big).&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I can&amp;rsquo;t change the DB because there are other applications using it&amp;rdquo;&amp;hellip; my friend in this case the first step should be write a good service layer to serve &amp;ldquo;externals&amp;rdquo; applications.&lt;/p&gt;
&lt;p&gt;Why, write a new .NET3.5 application, shouldn&amp;rsquo;t mean re-think the DB ? The DB is not a part of the old application ?&lt;/p&gt;
&lt;p&gt;We are working in software, is the relational DB a piece of granite technology of the past century and nothing more ?&lt;/p&gt;
&lt;p&gt;One of my preferred Mentor, illuminate me the way of ORM in these past years, is &lt;a target="_blank" href="http://www.ambysoft.com/scottAmbler.html"&gt;Scott W. Ambler&lt;/a&gt;. If you want help your DBA to come in the XXI century gives him some of Scott&amp;rsquo;s books. Waiting Christmas point him to &lt;a target="_blank" href="http://www.agiledata.org/essays/databaseRefactoring.html"&gt;this article&lt;/a&gt; and invite him to follow each singular link; perhaps you will win a friend.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-size:100%;"&gt;Dear DBA we are not your enemies, we are both in the same ship.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=393" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wlJdvhIK-dqMpW4RXksrJwV09_w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wlJdvhIK-dqMpW4RXksrJwV09_w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wlJdvhIK-dqMpW4RXksrJwV09_w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wlJdvhIK-dqMpW4RXksrJwV09_w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/gT2UuL8O-Ec" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NHibernate/default.aspx">NHibernate</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/26/database-the-eliot-ness-of-it.aspx</feedburner:origLink></item><item><title>Auto Quote Table/Column names</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/CJNh8eW0KRU/auto-quote-table-column-names.aspx</link><pubDate>Wed, 24 Jun 2009 03:25:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:383</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=383</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/24/auto-quote-table-column-names.aspx#comments</comments><description>&lt;p&gt;Since long time we have a very interesting request on &lt;a target="_blank" href="http://jira.nhforge.org/"&gt;NHibernate JIRA&lt;/a&gt; (NH-188).&lt;/p&gt;
&lt;p&gt;If you are working in a multi-RDBMS application, you are annoyed, for sure, quoting a table-name or a column-name. As a very good persistent-layer this should be a NHibernate&amp;rsquo;s work.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m happy to announce that the problem is solved (even if, so far, is not done by default).&lt;/p&gt;
&lt;p&gt;If you want that NH take the responsibility of properly quote table-name or column-name only where really needed now you can do it in two ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Trough configuration &lt;/li&gt;
&lt;li&gt;Explicitly by code &lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Trough configuration&lt;/h4&gt;
&lt;p&gt;As you probably know NHibernate&amp;rsquo;s configuration has some property oriented to mapping-to-DLL tasks.&lt;/p&gt;
&lt;p&gt;For schema integration you can use&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;hbm2ddl.auto&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;create-drop&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Allowed values for hbm2dll are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;update&lt;/span&gt; : auto execute &lt;span style="color:#2b91af;"&gt;SchemaUpdate&lt;/span&gt; on BuildSessionFactory &lt;/li&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;create&lt;/span&gt; : auto execute &lt;span style="color:#2b91af;"&gt;SchemaExport&lt;/span&gt; on BuildSessionFactory &lt;/li&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;create-drop&lt;/span&gt; : auto execute &lt;span style="color:#2b91af;"&gt;SchemaExport&lt;/span&gt; on BuildSessionFactory recreating the schema &lt;/li&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;validate&lt;/span&gt; : auto execute &lt;span style="color:#2b91af;"&gt;SchemaValidator&lt;/span&gt; on BuildSessionFactory &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The new property is:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;hbm2ddl.keywords&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;auto-quote&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Allowed values are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;none&lt;/span&gt; : disable any operation regarding RDBMS KeyWords &lt;/li&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;keywords&lt;/span&gt; : (&lt;strong&gt;activated by Default&lt;/strong&gt;)imports all RDBMS KeyWords where the NH-Dialect can provide the implementation of &lt;span style="color:#2b91af;"&gt;IDataBaseSchema&lt;/span&gt; (so far available for MsSQL, Oracle, Firebird, MsSqlCe, MySQL, SQLite, SybaseAnywhere) &lt;/li&gt;
&lt;li&gt;&lt;span style="color:#800000;"&gt;auto-quote&lt;/span&gt; : imports all RDBMS KeyWords and auto-quote all table-names/column-names on BuildSessionFactory &lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Explicitly by code&lt;/h4&gt;
&lt;p&gt;When you have an instance of a configured configuration (just before call BuildSessionFactory) you can execute:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:#2b91af;"&gt;SchemaMetadataUpdater&lt;/span&gt;.QuoteTableAndColumns(configuration);&lt;/pre&gt;
&lt;p&gt;That&amp;rsquo;s all.&lt;/p&gt;
&lt;h4&gt;The advantage&lt;/h4&gt;
&lt;p&gt;Take a look to this mapping:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;class &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Order&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;id &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;       &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;generator &lt;/span&gt;&lt;span style="color:red;"&gt;class&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;native&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Select&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;From&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;And&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Column&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Name&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;class&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Well&amp;hellip; now it is working fine without explicitly quote.&lt;/p&gt;
&lt;p&gt;Enjoy NHibernate&amp;rsquo;s multi-RDBMS easy support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=383" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vTVPbAufMUYBALrCuk_vQI7F6fs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vTVPbAufMUYBALrCuk_vQI7F6fs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vTVPbAufMUYBALrCuk_vQI7F6fs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vTVPbAufMUYBALrCuk_vQI7F6fs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/CJNh8eW0KRU" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/configuration/default.aspx">configuration</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NH2.1/default.aspx">NH2.1</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/24/auto-quote-table-column-names.aspx</feedburner:origLink></item><item><title>NHibernate Cache Providers 2.1.0Beta1</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/lbvTS-1r3zQ/nhibernate-cache-providers-2-1-0beta1.aspx</link><pubDate>Sun, 21 Jun 2009 15:52:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:376</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=376</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/21/nhibernate-cache-providers-2-1-0beta1.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;NHibernate Caches 2.1.0Beta1 was released today.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sourceforge.net/project/showfiles.php?group_id=216446&amp;amp;package_id=286204"&gt;Download NHibernate Caches 2.1.0Beta1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy it together with NHibernate2.1.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=376" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0fobTVQDdgwsqBxRULat7IgvP8A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0fobTVQDdgwsqBxRULat7IgvP8A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0fobTVQDdgwsqBxRULat7IgvP8A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0fobTVQDdgwsqBxRULat7IgvP8A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/lbvTS-1r3zQ" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/caches/default.aspx">caches</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/News/default.aspx">News</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/Release/default.aspx">Release</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/21/nhibernate-cache-providers-2-1-0beta1.aspx</feedburner:origLink></item><item><title>NHibernate 2.1.0Beta2</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/gL0oFXFxzM0/nhibernate-2-1-0beta2.aspx</link><pubDate>Sun, 21 Jun 2009 13:05:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:375</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=375</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/21/nhibernate-2-1-0beta2.aspx#comments</comments><description>&lt;p&gt;NHibernate 2.1.0 Beta2 is on the road.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="https://sourceforge.net/project/showfiles.php?group_id=73818&amp;amp;package_id=73969"&gt;Download NHibernate 2.1.0.Beta2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After download it please take a look to releasenotes.txt file.&lt;/p&gt;
&lt;p&gt;Note:&lt;/p&gt;
&lt;p&gt;For those are using sources, there is a new branch named : &lt;strong&gt;2.1.x&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;All next releases of NH2.1 will be released from the branch.&lt;/p&gt;
&lt;p&gt;The trunk, stating from few minutes, will be NH3.0.0 and its target is .NET3.5 (&lt;strong&gt;&amp;ldquo;&lt;em&gt;good bye&lt;/em&gt;&amp;rdquo; to .NET2.0 compatibility&lt;/strong&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=375" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Cs2ktq7opD0cOyEZPpk7zZdz7Rw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cs2ktq7opD0cOyEZPpk7zZdz7Rw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Cs2ktq7opD0cOyEZPpk7zZdz7Rw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cs2ktq7opD0cOyEZPpk7zZdz7Rw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/gL0oFXFxzM0" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/News/default.aspx">News</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NH2.1/default.aspx">NH2.1</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/21/nhibernate-2-1-0beta2.aspx</feedburner:origLink></item><item><title>From where start to implements IDataBaseSchema</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/GtUgOLrzryg/from-where-start-to-implements-idatabaseschema.aspx</link><pubDate>Fri, 12 Jun 2009 17:30:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:369</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=369</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/12/from-where-start-to-implements-idatabaseschema.aspx#comments</comments><description>&lt;p&gt;The &lt;a target="_blank" href="http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names.html"&gt;auto-quote and auto import KeyWords features&lt;/a&gt; are now available in NHibernate but only for those dialects are providing an implementation of &lt;span style="color:#2b91af;"&gt;IDataBaseSchema&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;If the NHibernate&amp;rsquo;s dialect, for your favorite RDBMS, does not provide an implementation of &lt;span style="color:#2b91af;"&gt;IDataBaseSchema&lt;/span&gt;, what can you do ?&lt;/p&gt;
&lt;h4&gt;Start point&lt;/h4&gt;
&lt;p&gt;First of all you need an easy way to know some &amp;ldquo;internals&amp;rdquo; of your DataProvider/RDBMS. The code to extract all information you are needing to implement a &lt;span style="color:#2b91af;"&gt;IDataBaseSchema&lt;/span&gt; is: &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;internal class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Program&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt; &lt;span style="color:blue;"&gt;private static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt; {&lt;br /&gt;  &lt;br /&gt;     &lt;span style="color:green;"&gt;// Extract metadata for Oracle&lt;br /&gt;     &lt;/span&gt;CreateMetadataXml(&lt;span style="color:#a31515;"&gt;&amp;quot;System.Data.OracleClient&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;User Id=NH; Password=nh&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;     &lt;span style="color:green;"&gt;// Extract metadata for MsSQL&lt;br /&gt;     &lt;/span&gt;CreateMetadataXml(&lt;span style="color:#a31515;"&gt;&amp;quot;System.Data.SqlClient&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;@&amp;quot;Data Source=localhost\SQLEXPRESS;Initial Catalog=NHTEST;Integrated Security=True&amp;quot;&lt;/span&gt;);&lt;br /&gt;  &lt;br /&gt;     &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Work done!&amp;quot;&lt;/span&gt;);&lt;br /&gt;     &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; &lt;span style="color:blue;"&gt;private static void &lt;/span&gt;CreateMetadataXml(&lt;span style="color:blue;"&gt;string &lt;/span&gt;providerName, &lt;span style="color:blue;"&gt;string &lt;/span&gt;connectionString)&lt;br /&gt; {&lt;br /&gt;     &lt;span style="color:#2b91af;"&gt;DbProviderFactory &lt;/span&gt;factory = &lt;span style="color:#2b91af;"&gt;DbProviderFactories&lt;/span&gt;.GetFactory(providerName);&lt;br /&gt;&lt;br /&gt;     &lt;span style="color:blue;"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;DbConnection &lt;/span&gt;conn = factory.CreateConnection())&lt;br /&gt;     {&lt;br /&gt;         &lt;span style="color:blue;"&gt;try&lt;br /&gt;         &lt;/span&gt;{&lt;br /&gt;             conn.ConnectionString = connectionString;&lt;br /&gt;             conn.Open();&lt;br /&gt;&lt;br /&gt;             &lt;span style="color:green;"&gt;//Get MetaDataCollections and write to an XML file.&lt;br /&gt;             //This is equivalent to GetSchema()&lt;br /&gt;             &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DataTable &lt;/span&gt;dtMetadata = conn.GetSchema(&lt;span style="color:#2b91af;"&gt;DbMetaDataCollectionNames&lt;/span&gt;.MetaDataCollections);&lt;br /&gt;             dtMetadata.WriteXml(providerName + &lt;span style="color:#a31515;"&gt;&amp;quot;_MetaDataCollections.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;             &lt;span style="color:green;"&gt;//Get Restrictions and write to an XML file.&lt;br /&gt;             &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DataTable &lt;/span&gt;dtRestrictions = conn.GetSchema(&lt;span style="color:#2b91af;"&gt;DbMetaDataCollectionNames&lt;/span&gt;.Restrictions);&lt;br /&gt;             dtRestrictions.WriteXml(providerName + &lt;span style="color:#a31515;"&gt;&amp;quot;_Restrictions.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;             &lt;span style="color:green;"&gt;//Get DataSourceInformation and write to an XML file.&lt;br /&gt;             &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DataTable &lt;/span&gt;dtDataSrcInfo = conn.GetSchema(&lt;span style="color:#2b91af;"&gt;DbMetaDataCollectionNames&lt;/span&gt;.DataSourceInformation);&lt;br /&gt;             dtDataSrcInfo.WriteXml(providerName + &lt;span style="color:#a31515;"&gt;&amp;quot;_DataSourceInformation.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;             &lt;span style="color:green;"&gt;//data types and write to an XML file.&lt;br /&gt;             &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DataTable &lt;/span&gt;dtDataTypes = conn.GetSchema(&lt;span style="color:#2b91af;"&gt;DbMetaDataCollectionNames&lt;/span&gt;.DataTypes);&lt;br /&gt;             dtDataTypes.WriteXml(providerName + &lt;span style="color:#a31515;"&gt;&amp;quot;_DataTypes.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;             &lt;span style="color:green;"&gt;//Get ReservedWords and write to an XML file.&lt;br /&gt;             &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DataTable &lt;/span&gt;dtReservedWords = conn.GetSchema(&lt;span style="color:#2b91af;"&gt;DbMetaDataCollectionNames&lt;/span&gt;.ReservedWords);&lt;br /&gt;             dtReservedWords.WriteXml(providerName + &lt;span style="color:#a31515;"&gt;&amp;quot;_ReservedWords.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;         }&lt;br /&gt;         &lt;span style="color:blue;"&gt;catch &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Exception &lt;/span&gt;ex)&lt;br /&gt;         {&lt;br /&gt;             &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(ex.Message);&lt;br /&gt;             &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(ex.StackTrace);&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;The code above will create an XML file for each &amp;ldquo;matter&amp;rdquo; involved with &lt;span style="color:#2b91af;"&gt;IDataBaseSchema&lt;/span&gt; implementation.&lt;/p&gt;
&lt;h4&gt;What&amp;rsquo;s next&lt;/h4&gt;
&lt;p&gt;I don&amp;rsquo;t want to deep in details because each RDBMS may have different info so the only things I can tell you are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There are some base classes that may work, as is, for your RDBMS : &lt;span style="color:#2b91af;"&gt;AbstractDataBaseSchema&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;AbstractTableMetadata&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;AbstractColumnMetaData&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;AbstractForeignKeyMetadata&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;AbstractIndexMetadata&lt;/span&gt;. &lt;/li&gt;
&lt;li&gt;There are some implementations for various RDBMS where you can see which are the difference and where some information, extracted from the code above, was used : FirebirdMetaData.cs, MsSqlCeMetaData.cs, MsSqlMetaData.cs, MySQLMetaData.cs, OracleMetaData.cs, SQLiteMetaData.cs, SybaseAnywhereMetaData.cs. &lt;/li&gt;
&lt;li&gt;Tests to pass are contained in NHibernate.Test.Tools.hbm2ddl namespace. &lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;What you should do after implement IDataBaseSchema&lt;/h4&gt;
&lt;p&gt;Create a new &lt;a target="_blank" href="http://jira.nhforge.org/"&gt;JIRA ticket&lt;/a&gt; as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Project : NHibernate &lt;/li&gt;
&lt;li&gt;Issue Type: Improvement &lt;/li&gt;
&lt;li&gt;Summary : New DataBase schema provider for &lt;em&gt;&amp;ldquo;your preferred RDBMS&amp;rdquo;&lt;/em&gt; &lt;/li&gt;
&lt;li&gt;Priority : Minor &lt;/li&gt;
&lt;li&gt;Component : DataProviders / Dialects &lt;/li&gt;
&lt;li&gt;Affects Version : &lt;em&gt;&amp;ldquo;The last released&amp;rdquo;&lt;/em&gt; &lt;/li&gt;
&lt;li&gt;Description : &lt;em&gt;&amp;ldquo;Few words&amp;rdquo;&lt;/em&gt; &lt;/li&gt;
&lt;li&gt;Attachment : this is the most important; &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;send us your implementation&lt;/strong&gt;&lt;/span&gt;!! &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=369" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/B1SHGBXAdqhy19KmV1rBpTsVVnQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/B1SHGBXAdqhy19KmV1rBpTsVVnQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/B1SHGBXAdqhy19KmV1rBpTsVVnQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/B1SHGBXAdqhy19KmV1rBpTsVVnQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/GtUgOLrzryg" height="1" width="1"/&gt;</description><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/12/from-where-start-to-implements-idatabaseschema.aspx</feedburner:origLink></item><item><title>LINQ to NHibernate Update</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/m_H7x6Bjg9Q/linq-to-nhibernate-update.aspx</link><pubDate>Thu, 11 Jun 2009 13:50:40 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:367</guid><dc:creator>Steve Strong</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=367</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/11/linq-to-nhibernate-update.aspx#comments</comments><description>&lt;p&gt;We&amp;#39;re long overdue for another update. Progress as been somewhat slower over the last few weeks, largely due to other commitments and holidays meaning that I&amp;#39;ve probably only spent a total of around 10 days working on this stuff.&lt;/p&gt;
&lt;p&gt;Where we are is that I&amp;#39;m pretty comfortable with what needs to happen, and have a fairly clear route for moving forward from my prototype / exploratory coding phase to something that I can actually release to the wild and let folk start playing with.&lt;/p&gt;
&lt;p&gt;There are two options as to how this might happen. The first is by utilizing the concepts within the excellent &lt;a href="http://www.codeplex.com/IQToolkit"&gt;IQToolkit&lt;/a&gt;, which provides a great sample for anyone who wants to explore how to build a Linq to Sql provider. Alas, the code can&amp;#39;t be used as it stands, since it&amp;#39;s quite closely tied to building and executing SQL and then processing the resulting data rows, which isn&amp;#39;t quite what we&amp;#39;re trying to achieve here. However, the fundamental concepts and algorithms for handling some of the Linq complexities are certainly valid, and can be ported across to meet our needs relatively simply.&lt;/p&gt;
&lt;p&gt;The second option is by building on top of the promising &lt;a href="http://www.re-motion.org/blogs/team/archive/2009/04/23/introducing-re-linq-a-general-purpose-linq-provider-infrastructure.aspx"&gt;re-linq&lt;/a&gt; project, which performs a similar task to the first half of the IQ Toolkit, in that it takes a Linq expression tree and turns it into something a little more manageable. re-linq doesn&amp;#39;t attempt to handle the execution side, so it precisely avoids some of the stuff that I&amp;#39;d need to rip out of the IQ Toolkit.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;re-linq is currently undergoing some final refactoring (some of it driven by the potential to use it within this project,so many thanks to them for keeping us in mind!). This is due to be completed in the next 3 or so weeks; once they are done, a final decision as to the exact approach can be taken and I&amp;#39;d expect pretty fast progress from that point.&lt;/p&gt;
&lt;p&gt;Obviously, my original guesstimate of a June date is looking seriously in doubt, but I don&amp;#39;t think it&amp;#39;ll be too much longer. Hang in there folks, I know it&amp;#39;s been a long wait but it&amp;#39;ll be worth it!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=367" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RDjBlgTkMsOITqxaUc0oQM0Q-zg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RDjBlgTkMsOITqxaUc0oQM0Q-zg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RDjBlgTkMsOITqxaUc0oQM0Q-zg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RDjBlgTkMsOITqxaUc0oQM0Q-zg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/m_H7x6Bjg9Q" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/linq/default.aspx">linq</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/11/linq-to-nhibernate-update.aspx</feedburner:origLink></item><item><title>NHibernate Cache Providers 2.1.0Alpha1</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/cpNixX7KTsw/nhibernate-cache-providers-2-1-0alpha1.aspx</link><pubDate>Sun, 07 Jun 2009 17:03:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:360</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=360</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/07/nhibernate-cache-providers-2-1-0alpha1.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;NHibernate Caches 2.1.0Alpha1 was released today.&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="https://sourceforge.net/project/showfiles.php?group_id=216446&amp;amp;package_id=286204"&gt;Download NHibernate Caches 2.1.0Alpha1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy it together with NHibernate2.1.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=360" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RxWYl4gCXA_Y2wacgE80MwRn7zQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RxWYl4gCXA_Y2wacgE80MwRn7zQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RxWYl4gCXA_Y2wacgE80MwRn7zQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RxWYl4gCXA_Y2wacgE80MwRn7zQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/cpNixX7KTsw" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/caches/default.aspx">caches</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/News/default.aspx">News</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/07/nhibernate-cache-providers-2-1-0alpha1.aspx</feedburner:origLink></item><item><title>NHibernate 2.1.0Beta1</title><link>http://feedproxy.google.com/~r/NHibernateBlog/~3/2A5sqZhobec/nhibernate-2-1-0beta1.aspx</link><pubDate>Sun, 07 Jun 2009 15:28:00 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:358</guid><dc:creator>Fabio Maulo</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://nhforge.org/blogs/nhibernate/rsscomments.aspx?PostID=358</wfw:commentRss><comments>http://nhforge.org/blogs/nhibernate/archive/2009/06/07/nhibernate-2-1-0beta1.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;NHibernate 2.1.0Beta1 was released today.&lt;/strong&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;a target="_blank" href="https://sourceforge.net/project/showfiles.php?group_id=73818"&gt;Download NHibernate 2.1.0.Beta1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After download it please take a look to releasenotes.txt file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://nhforge.org/aggbug.aspx?PostID=358" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v8mExyiSblFuCgLsuxoLFmYAou4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v8mExyiSblFuCgLsuxoLFmYAou4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v8mExyiSblFuCgLsuxoLFmYAou4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v8mExyiSblFuCgLsuxoLFmYAou4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/NHibernateBlog/~4/2A5sqZhobec" height="1" width="1"/&gt;</description><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/News/default.aspx">News</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://nhforge.org/blogs/nhibernate/archive/tags/NH2.1/default.aspx">NH2.1</category><feedburner:origLink>http://nhforge.org/blogs/nhibernate/archive/2009/06/07/nhibernate-2-1-0beta1.aspx</feedburner:origLink></item></channel></rss>
