<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Testing Immutable Entities with NHibernate</title>
	<atom:link href="http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/</link>
	<description></description>
	<lastBuildDate>Wed, 21 Mar 2012 14:32:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: James</title>
		<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/comment-page-1/#comment-5262</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 14 Dec 2010 18:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://jameskovacs.com/2007/11/05/Testing+Immutable+Entities+With+NHibernate#comment-5262</guid>
		<description>@Ramon - Unfortunately if you declare your ctor as protected, you can&#039;t create instances of Invoice in unit tests without resorting to Activator.CreateInstance or a similar technique. My overall point of this post was that you might have readonly data that you want to insert into your database for testing purposes. This technique allows you to modify your NH configuration to allow inserts of readonly data during the setup of your integration tests, but not in your production code.</description>
		<content:encoded><![CDATA[<p>@Ramon &#8211; Unfortunately if you declare your ctor as protected, you can&#8217;t create instances of Invoice in unit tests without resorting to Activator.CreateInstance or a similar technique. My overall point of this post was that you might have readonly data that you want to insert into your database for testing purposes. This technique allows you to modify your NH configuration to allow inserts of readonly data during the setup of your integration tests, but not in your production code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramon Smits</title>
		<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/comment-page-1/#comment-3985</link>
		<dc:creator>Ramon Smits</dc:creator>
		<pubDate>Thu, 18 Nov 2010 10:26:45 +0000</pubDate>
		<guid isPermaLink="false">http://jameskovacs.com/2007/11/05/Testing+Immutable+Entities+With+NHibernate#comment-3985</guid>
		<description>If you want readonly data then just make the contructor PROTECTED. You classes should indicate what kind of behavior is allowed. NHibernate is only there to help you persist and retrieve your data in an efficient way.

Using a protected contructor will allow nhibernate to create proxies but will not allow you to create an instance of that class.</description>
		<content:encoded><![CDATA[<p>If you want readonly data then just make the contructor PROTECTED. You classes should indicate what kind of behavior is allowed. NHibernate is only there to help you persist and retrieve your data in an efficient way.</p>
<p>Using a protected contructor will allow nhibernate to create proxies but will not allow you to create an instance of that class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjorne Bjornson</title>
		<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/comment-page-1/#comment-138</link>
		<dc:creator>Bjorne Bjornson</dc:creator>
		<pubDate>Mon, 11 Jan 2010 15:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://jameskovacs.com/2007/11/05/Testing+Immutable+Entities+With+NHibernate#comment-138</guid>
		<description>Different Hibernate/NHibernate reference documentation versions do indeed state, that &quot;you can set other properties (and even change the mapping metadata) by accessing the Configuration before you build the ISessionFactory&quot;. But the same docs do also state, that &quot;immutable classes, mutable=false, cannot be updated or deleted by the application&quot;. For there is no &quot;NHibernate will not permit INSERT (...) against the entity&quot;[sic] at all, inserting just works as expected. I wonder what this article is all about then.</description>
		<content:encoded><![CDATA[<p>Different Hibernate/NHibernate reference documentation versions do indeed state, that &quot;you can set other properties (and even change the mapping metadata) by accessing the Configuration before you build the ISessionFactory&quot;. But the same docs do also state, that &quot;immutable classes, mutable=false, cannot be updated or deleted by the application&quot;. For there is no &quot;NHibernate will not permit INSERT (&#8230;) against the entity&quot;[sic] at all, inserting just works as expected. I wonder what this article is all about then.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Chambers</title>
		<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/comment-page-1/#comment-137</link>
		<dc:creator>Sean Chambers</dc:creator>
		<pubDate>Sat, 28 Jun 2008 11:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://jameskovacs.com/2007/11/05/Testing+Immutable+Entities+With+NHibernate#comment-137</guid>
		<description>Great tip.

I just ran into something like this during the week. I think how I solved it was to first insert the rows outside the scope of nhibernate and then ran tests against it. It worked but was a little smelly. This is a much better solution. Thanks!</description>
		<content:encoded><![CDATA[<p>Great tip.</p>
<p>I just ran into something like this during the week. I think how I solved it was to first insert the rows outside the scope of nhibernate and then ran tests against it. It worked but was a little smelly. This is a much better solution. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dario Quintana</title>
		<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/comment-page-1/#comment-136</link>
		<dc:creator>Dario Quintana</dc:creator>
		<pubDate>Mon, 05 Nov 2007 17:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://jameskovacs.com/2007/11/05/Testing+Immutable+Entities+With+NHibernate#comment-136</guid>
		<description>Hi James, nice trick and blog.

@Ben: Yes, you could, everything you want before the buildSessionFactory(), the ISessionFactoy go to determinate the future sessions.

Another thing that come to my mind it&#039;s that NHibernate at next version (or some next version) with the Entity-Name port will do dissapear the methods with typeof(...) definition, only the generics and entity-Name methods will stay.

Best regards

</description>
		<content:encoded><![CDATA[<p>Hi James, nice trick and blog.</p>
<p>@Ben: Yes, you could, everything you want before the buildSessionFactory(), the ISessionFactoy go to determinate the future sessions.</p>
<p>Another thing that come to my mind it&#8217;s that NHibernate at next version (or some next version) with the Entity-Name port will do dissapear the methods with typeof(&#8230;) definition, only the generics and entity-Name methods will stay.</p>
<p>Best regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Scheirman</title>
		<link>http://jameskovacs.com/2007/11/04/testing-immutable-entities-with-nhibernate/comment-page-1/#comment-135</link>
		<dc:creator>Ben Scheirman</dc:creator>
		<pubDate>Mon, 05 Nov 2007 15:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://jameskovacs.com/2007/11/05/Testing+Immutable+Entities+With+NHibernate#comment-135</guid>
		<description>Awesome! I didn&#039;t know you could do this.</description>
		<content:encoded><![CDATA[<p>Awesome! I didn&#8217;t know you could do this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

