<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dario Quintana &#187; uNHAddIns</title>
	<atom:link href="http://darioquintana.com.ar/blogging/category/nhibernate/unhaddins/feed/" rel="self" type="application/rss+xml" />
	<link>http://darioquintana.com.ar/blogging</link>
	<description>at blogging</description>
	<lastBuildDate>Mon, 30 Apr 2012 07:05:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>3 layer Example of NHibernate + Spring.Net + AOP</title>
		<link>http://darioquintana.com.ar/blogging/2007/11/17/3-layer-example-of-nhibernate-springnet-aop/</link>
		<comments>http://darioquintana.com.ar/blogging/2007/11/17/3-layer-example-of-nhibernate-springnet-aop/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 14:15:28 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[Aop]]></category>
		<category><![CDATA[IoC]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[uNHAddIns]]></category>

		<guid isPermaLink="false">http://darioquintana.com.ar/blogging/?p=19</guid>
		<description><![CDATA[<p>Sometime ago I wrote this template project using <a href="http://springframework.net/">Spring.Net</a> and <a href="http://www.hibernate.org/343.html">NHibernate</a>primarily. I use <a href="http://www.hibernate.org/343.html">NHibernate</a> for the data access and <a href="http://springframework.net/">Spring.Net</a>for the IoC and Aop. With the Aop support, the transaction managmente it&#8217;s very easy to implement.</p> <p>This it&#8217;s the CustomerService class:</p> public class CustomerService : BaseService, ICustomerService { /// &#60;summary&#62; /// [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime ago I wrote this template project using <a href="http://springframework.net/">Spring.Net</a> and <a href="http://www.hibernate.org/343.html">NHibernate</a>primarily. I use <a href="http://www.hibernate.org/343.html">NHibernate</a> for the data access and <a href="http://springframework.net/">Spring.Net</a>for the IoC and Aop. With the Aop support, the transaction managmente it&#8217;s very easy to implement.</p>
<p>This it&#8217;s the <em>CustomerService</em> class:</p>
<pre class="csharpcode">
    <span class="kwrd">public</span> <span class="kwrd">class</span> CustomerService : BaseService, ICustomerService
    {
	<span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// This field is inyected by IoC through the property.</span>
        <span class="rem">/// &lt;/summary&gt;</span>

        <span class="kwrd">private</span> ICustomerDao customerDao;        <span class="kwrd"></span>
 <span class="kwrd">	public</span> ICustomerDao CustomerDao {
            get { <span class="kwrd">return</span> customerDao; }
          set { customerDao = <span class="kwrd">value</span>; }
        }

<span class="preproc">#region</span> ICustomerService Members

<span class="kwrd">	public</span> <span class="kwrd">int</span> CreateCustomer(<span class="kwrd">string</span> Name, <span class="kwrd">string</span> LastName) {

        	Customer customer = <span class="kwrd">new</span> Customer();

        	customer.FirstName = <span class="str">"Dario"</span>;

	        customer.LastName = <span class="str">"Quintana"</span>;

		CustomerDao.Save(customer);

<span class="kwrd">		return</span> customer.Id;

        }

<span class="kwrd">	public</span> <span class="kwrd">void</span> DeleteCustomer(<span class="kwrd">int</span> Id) {

            	Customer customer = CustomerDao.GetById(Id);

		CustomerDao.Delete(customer);

        }

<span class="preproc">#endregion</span>

    }</pre>
<p>As you can see, the <em>CreateCustomer</em> or <em>DeleteCustomer</em> is not envolved at code by anyone Transactional or UnitOfWork code, nor the method <em>Save(customer)</em> at <em>CustomerDao</em> class.</p>
<p>Then&#8230; where it&#8217;s the transactional support ? Spring + AOP is the answer. Spring envolves al Service methods between transaccions.</p>
<p>When you instantiate the class CustomerService, a proxy is instantiate insted. With the proxy Spring.Net can envolve the method configurated into transactions. Cool uh?</p>
<p>Another thing that you can appreciate at example it&#8217;s the using of <a href="http://code.google.com/p/unhaddins/">uNhAddIns</a> at Repository stuff. With this library you can use Hql/Sql queries detached with the class <a href="http://darioquintana.com.ar/blogging/?p=5">DetachedQuery</a>. With DetachedQuery you can use <a href="http://darioquintana.com.ar/blogging/?p=7">NamedQuery and this a good practice to adopt</a>.</p>
<h4><a href="http://code.google.com/p/darioquintana/downloads/detail?name=SpringNHAop.7z">Download the Example</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://darioquintana.com.ar/blogging/2007/11/17/3-layer-example-of-nhibernate-springnet-aop/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ActiveRecord and support for DetachedQuery</title>
		<link>http://darioquintana.com.ar/blogging/2007/11/11/activerecord-and-support-for-detachedquery/</link>
		<comments>http://darioquintana.com.ar/blogging/2007/11/11/activerecord-and-support-for-detachedquery/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 19:34:32 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[uNHAddIns]]></category>

		<guid isPermaLink="false">http://darioquintana.com.ar/blogging/?p=15</guid>
		<description><![CDATA[<p>This weekend I wrote the classes necessaries to support IDetachedQuery with <a href="http://www.castleproject.org/activerecord/index.html">ActiveRecord</a>. <a href="http://code.google.com/p/unhaddins/wiki/LesTroisMousquetaires">DetachedQuery</a> it&#8217;s not available yet at any version of <a href="http://www.nhibernate.org">NHibernate</a>, you can find it only in <a href="http://code.google.com/p/unhaddins/">uNHAddIns</a> and at the SVN of NHibernate.</p> <p>I add a project to uNHAddIns: <a href="http://code.google.com/p/unhaddins/wiki/ActiveRecordAndDetachedQuery">uNHAddIns.ActiveRecord</a>. This consist in the classical classes for ActiveRecord [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I wrote the classes necessaries to support IDetachedQuery with <a href="http://www.castleproject.org/activerecord/index.html">ActiveRecord</a>. <a href="http://code.google.com/p/unhaddins/wiki/LesTroisMousquetaires">DetachedQuery</a> it&#8217;s not available yet at any version of <a href="http://www.nhibernate.org">NHibernate</a>, you can find it only in <a href="http://code.google.com/p/unhaddins/">uNHAddIns</a> and at the SVN of NHibernate.</p>
<p>I add a project to uNHAddIns: <a href="http://code.google.com/p/unhaddins/wiki/ActiveRecordAndDetachedQuery">uNHAddIns.ActiveRecord</a>. This consist in the classical classes for ActiveRecord with support for IDetachedQuery.</p>
<p>If we want support for IDetachedQuery using <a href="http://www.castleproject.org/activerecord/index.html">ActiveRecord</a> you must this clases:</p>
<ul>
<li><tt>ActiveRecordBase</tt></li>
<li><tt>ActiveRecordBase&lt;T&gt;</tt></li>
<li><tt>ActiveRecordValidationBase</tt></li>
<li>and <tt>ActiveRecordValidationBase&lt;T&gt;</tt></li>
</ul>
<p>Now you will able to do somethings like this:</p>
<pre>Customer[] customers = Customer.FindAll(new DetachedQuery("from Customer Order By Name"));</pre>
<p>The new methods for ActiveRecordBase and ActiveRecordValidationBase are:</p>
<ul>
<li>
<pre>public static bool Exists(Type targetType, IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static Array FindAll(Type targetType, IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static object FindFirst(Type targetType, IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static object FindOne(Type targetType, IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static Array SlicedFindAll(Type targetType, int firstResult, int maxResults, IDetachedQuery detachedQuery);</pre>
</li>
</ul>
<p>And the new methods for ActiveRecordBase&lt;T&gt; and ActiveRecordValidationBase&lt;T&gt; are:</p>
<ul>
<li>
<pre>public static bool Exists(IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static T[] FindAll(IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static T FindFirst(IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static T FindOne(IDetachedQuery detachedQuery);</pre>
</li>
<li>
<pre>public static T[] SlicedFindAll(int firstResult, int maxResults, IDetachedQuery detachedQuery);</pre>
</li>
</ul>
<p>This implementation no hide any feature of ActiveRecord base classes, it&#8217;s a extension for IDetachedQuery support.</p>
<h4>Requeriments</h4>
<p>This classes are provided in the assembly <tt>uNHAddIns.ActiveRecord.dll</tt>. And this assembly require the main assembly of the project: <tt>uNHAddIns.dll</tt>.</p>
<h4><a href="http://unhaddins.googlecode.com/files/uNHAddIns%20-%20binaries%20-%20Revision%2071.7z">Downloads here</a></h4>
<h4><a href="http://code.google.com/p/unhaddins/wiki/ActiveRecordAndDetachedQuery">Wiki entry</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://darioquintana.com.ar/blogging/2007/11/11/activerecord-and-support-for-detachedquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Validation on NHibernate</title>
		<link>http://darioquintana.com.ar/blogging/2007/11/01/validation-on-nhibernate/</link>
		<comments>http://darioquintana.com.ar/blogging/2007/11/01/validation-on-nhibernate/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 16:21:02 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[uNHAddIns]]></category>

		<guid isPermaLink="false">http://darioquintana.com.ar/blogging/?p=14</guid>
		<description><![CDATA[<p>The open door that the <a href="http://darioquintana.com.ar/blogging/?p=9">EventListeners</a> port let for us, it&#8217;s the possibility to create some classes in order to validate objects before them were saved (and before were deleted too).</p> <p>An option is port <a href="http://www.hibernate.org/412.html">Hibernate.Validator</a>, but&#8230; will be used by anyone? I don&#8217;t think so. Looking it implementation and what it do, [...]]]></description>
			<content:encoded><![CDATA[<p>The open door that the <a href="http://darioquintana.com.ar/blogging/?p=9">EventListeners</a> port let for us, it&#8217;s the possibility to create some classes in order to validate objects before them were saved (and before were deleted too).</p>
<p>An option is port <a href="http://www.hibernate.org/412.html">Hibernate.Validator</a>, but&#8230; will be used by anyone? I don&#8217;t think so. Looking it implementation and what it do, do not offer much more that you can find of .Net side with some existent libraries. Maybe some day <a href="http://www.hibernate.org/412.html">Hibernate.Validator</a> will be ported, by now, I think that it&#8217;s so much important finish the port of the <a href="http://darioquintana.com.ar/blogging/?p=13">features of Hibernate 3.2.5 GA</a>.</p>
<p>Another valid option, it&#8217;s create bridges between NHibernate (<a href="http://darioquintana.com.ar/blogging/?p=9">EventListeners</a>) and somes known framework for .Net for input validation:</p>
<ul>
<li><a href="http://codeplex.com/entlib">Validation Application Block (Enterprise Library).</a></li>
<li><a href="http://www.lhotka.net/cslanet/">Validation de Csla.Net</a></li>
</ul>
<p>The implementation, either Hibernate.Validator (I don&#8217;t think so) or the bridges for the citated, will be at <a href="http://code.google.com/p/unhaddins/">uNHAddIns</a>.</p>
<p>An interesting point, will be the extensibility option for home made validatores.</p>
]]></content:encoded>
			<wfw:commentRss>http://darioquintana.com.ar/blogging/2007/11/01/validation-on-nhibernate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>uNHAddIns new release available &#8211; Revision 64</title>
		<link>http://darioquintana.com.ar/blogging/2007/10/18/unhaddins-new-release-available-revision-64/</link>
		<comments>http://darioquintana.com.ar/blogging/2007/10/18/unhaddins-new-release-available-revision-64/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 06:27:26 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[uNHAddIns]]></category>

		<guid isPermaLink="false">http://darioquintana.com.ar/blogging/?p=6</guid>
		<description><![CDATA[<p>By internal policies <a href="http://code.google.com/p/unhaddins/">uNHAddins</a> not have yet a release number o release version name, by now we are using the revision number at SVN for this purpose. Probably will come a branch when NHibernate 2.0 release appear, and that will be the time.</p> <p><a href="http://code.google.com/p/unhaddins/downloads/detail?name=uNhAddIns%20-%20binaries%20-%20revision%2064.7z&#38;can=2&#38;q=">Download here</a></p> <p>Features of new version:</p> Added UserType: <a href="http://code.google.com/p/unhaddins/wiki/UpperStringUserType">UpperString</a>. [...]]]></description>
			<content:encoded><![CDATA[<p>By internal policies <a href="http://code.google.com/p/unhaddins/">uNHAddins</a> not have yet a release number o release version name, by now we are using the revision number at SVN for this purpose. Probably will come a branch when NHibernate 2.0 release appear, and that will be the time.</p>
<p><a href="http://code.google.com/p/unhaddins/downloads/detail?name=uNhAddIns%20-%20binaries%20-%20revision%2064.7z&amp;can=2&amp;q=">Download here</a></p>
<p>Features of new version:</p>
<ul>
<li>Added UserType: <a href="http://code.google.com/p/unhaddins/wiki/UpperStringUserType">UpperString</a>. Allow save/get strings against the database in upper case.
<li>Few features at pagination.
<li>Documentation enhanced.
<li>Cloner helper for make objects clone via binary serialization.
<li>Build files for compiler using NAnt.</li>
</ul>
<p>For more resources visit:</p>
<ul>
<li><a href="http://code.google.com/p/unhaddins/w/list">Wiki</a>
<li><a href="http://groups.google.com/group/unhaddins?hl=en">Discussion Group</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://darioquintana.com.ar/blogging/2007/10/18/unhaddins-new-release-available-revision-64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uNHAddins: UnOfficial NHibernate AddIns</title>
		<link>http://darioquintana.com.ar/blogging/2007/09/06/unhaddins-unofficial-nhibernate-addins/</link>
		<comments>http://darioquintana.com.ar/blogging/2007/09/06/unhaddins-unofficial-nhibernate-addins/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 03:01:19 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[uNHAddIns]]></category>

		<guid isPermaLink="false">http://darioquintana.com.ar/blogging/?p=5</guid>
		<description><![CDATA[<p>Fabio Maulo, with who I got the honor of moderate <a href="http://groups.google.com/group/nhibernate-hispano">NHibernate-Hispano</a>, put to our disposition this new project calls <a href="http://code.google.com/p/unhaddins">uNHAddIns</a>. UnOfficial NHibernate Add-Ins provide resources to interactuate with NHibernate, it&#8217;s like Contrib package. For now, and just for now, we can use this cool features:</p> DetachedCriteria, DetachedQuery DetachedDynQuery Paginator. <p>DetachedQuery it&#8217;s the brother [...]]]></description>
			<content:encoded><![CDATA[<p>Fabio Maulo, with who I got the honor of moderate <a href="http://groups.google.com/group/nhibernate-hispano">NHibernate-Hispano</a>, put to our disposition this new project calls <a href="http://code.google.com/p/unhaddins">uNHAddIns</a>. UnOfficial NHibernate Add-Ins provide resources to interactuate with NHibernate, it&#8217;s like Contrib package. For now, and just for now, we can use this cool features:</p>
<ul>
<li>DetachedCriteria,</li>
<li>DetachedQuery</li>
<li>DetachedDynQuery</li>
<li>Paginator.</li>
</ul>
<p>DetachedQuery it&#8217;s the brother of DetachedCriteria, and doesn&#8217;t exists at NHibernate yet. DetachedCriteria it&#8217;s at NHibernate long ago, but there was not something similar for HQL. DetachedQuery/DetachedCriteria, it&#8217;s usefull to use in places where we don&#8217;t have a Session. It&#8217;s a good method to retardate until the last moment the association with the query and this help to play a lot at Generics DAOs implementations and their inheritances. <u>Resources</u>:</p>
<ul>
<li><a href="http://unhaddins.googlecode.com">Project Site</a></li>
<li><a href="http://code.google.com/p/unhaddins/w/list">Wiki</a></li>
<li><a href="http://groups.google.com/group/unhaddins">Discussion group of uNHAddIns</a></li>
<li><a href="http://code.google.com/p/unhaddins/wiki/LesTroisMousquetaires" title="http://code.google.com/p/unhaddins/wiki/LesTroisMousquetaires">LesTroisMousquetaires:DetachedCriteria,DetachedQuery y DetachedDynQuery</a></li>
<li><a href="http://code.google.com/p/unhaddins/downloads/list">Downloads</a></li>
</ul>
<p>Forward I gonna make some post about uNHAddIns, for questions visit the <a href="http://groups.google.com/group/unhaddins">group</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://darioquintana.com.ar/blogging/2007/09/06/unhaddins-unofficial-nhibernate-addins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

