<?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: Mapping Strings to Booleans Using NHibernate&#8217;s IUserType</title>
	<atom:link href="http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/</link>
	<description></description>
	<lastBuildDate>Tue, 02 Apr 2013 20:36:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: FluentNhibernate: map byte enum as char &#124; trouble86.com</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-1679</link>
		<dc:creator>FluentNhibernate: map byte enum as char &#124; trouble86.com</dc:creator>
		<pubDate>Sun, 23 Oct 2011 13:26:53 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-1679</guid>
		<description>[...] implement your own type conversion using IUserType interface. Example how to do that can be found here or [...]</description>
		<content:encoded><![CDATA[<p>[...] implement your own type conversion using IUserType interface. Example how to do that can be found here or [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric swann</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-28</link>
		<dc:creator>eric swann</dc:creator>
		<pubDate>Sun, 30 May 2010 23:05:53 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-28</guid>
		<description>Cool, glad I found this article Ray, I was just trying to do a wierd date conversion from our DB, I think this approach is what I&#039;m looking for.</description>
		<content:encoded><![CDATA[<p>Cool, glad I found this article Ray, I was just trying to do a wierd date conversion from our DB, I think this approach is what I&#8217;m looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rune</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-27</link>
		<dc:creator>Rune</dc:creator>
		<pubDate>Mon, 22 Dec 2008 14:33:51 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-27</guid>
		<description>Just spotted this post. I have a similar problem and this solution does not seem directly applicable. I am from Denmark which means that instead of using Y/N in the database my predecessors opted for J/N. Can I somehow still use type=&quot;YesNo&quot; or do I have to use your YesNoType class?</description>
		<content:encoded><![CDATA[<p>Just spotted this post. I have a similar problem and this solution does not seem directly applicable. I am from Denmark which means that instead of using Y/N in the database my predecessors opted for J/N. Can I somehow still use type=&#8221;YesNo&#8221; or do I have to use your YesNoType class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Houston</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-26</link>
		<dc:creator>Ray Houston</dc:creator>
		<pubDate>Mon, 24 Mar 2008 11:10:14 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-26</guid>
		<description>@Matt - dang! How did I miss that? Anyway, thanks for pointing that out.</description>
		<content:encoded><![CDATA[<p>@Matt &#8211; dang! How did I miss that? Anyway, thanks for pointing that out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-25</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 24 Mar 2008 09:22:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-25</guid>
		<description>This is already built into NHibernate.. do type=YesNo


http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html_single/#mapping-types-basictypes

</description>
		<content:encoded><![CDATA[<p>This is already built into NHibernate.. do type=YesNo</p>
<p><a href="http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html_single/#mapping-types-basictypes" rel="nofollow">http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html_single/#mapping-types-basictypes</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Houston</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-24</link>
		<dc:creator>Ray Houston</dc:creator>
		<pubDate>Sun, 23 Mar 2008 21:05:45 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-24</guid>
		<description>@Ken - I think we&#039;re talking about two different things.

In my entity I may have a property like
public bool Active { get; set; }

In the database, the column is a string (because it&#039;s legacy). My custom IUserType only shows up in the NH mapping and no where else. NH invokes it for me. It expects a string to come out of the database and then converts it to a bool (and vise versa going the other way). This all happens under the hood and my domain classes never know that it&#039;s stored as a string in the database.

I&#039;m going to post another example which might clear things up a bit.</description>
		<content:encoded><![CDATA[<p>@Ken &#8211; I think we&#8217;re talking about two different things.</p>
<p>In my entity I may have a property like<br />
public bool Active { get; set; }</p>
<p>In the database, the column is a string (because it&#8217;s legacy). My custom IUserType only shows up in the NH mapping and no where else. NH invokes it for me. It expects a string to come out of the database and then converts it to a bool (and vise versa going the other way). This all happens under the hood and my domain classes never know that it&#8217;s stored as a string in the database.</p>
<p>I&#8217;m going to post another example which might clear things up a bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Scott</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-23</link>
		<dc:creator>Ken Scott</dc:creator>
		<pubDate>Sun, 23 Mar 2008 19:00:49 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-23</guid>
		<description>So, the classes that you have talking directly to NHibernate are just a form of mapper or DTO class? Interesting...

How much churn do you have in your model that forces you to update the intermediate layer and/or the database? Do you have some sort of reflection/code generation to create an entity class from a DTO and vice versa?</description>
		<content:encoded><![CDATA[<p>So, the classes that you have talking directly to NHibernate are just a form of mapper or DTO class? Interesting&#8230;</p>
<p>How much churn do you have in your model that forces you to update the intermediate layer and/or the database? Do you have some sort of reflection/code generation to create an entity class from a DTO and vice versa?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Houston</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-22</link>
		<dc:creator>Ray Houston</dc:creator>
		<pubDate>Sun, 23 Mar 2008 14:47:46 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-22</guid>
		<description>@Ken - that&#039;s the cool thing about this. My domain doesn&#039;t reference my YesNoType. It my domain, I use plain old booleans. It might be less confusing if I had named this class YesNoMapper. It&#039;s used for translating the database types, to .NET types.  The .NET type can be anything you want as long as you supply the logic here to translate it.</description>
		<content:encoded><![CDATA[<p>@Ken &#8211; that&#8217;s the cool thing about this. My domain doesn&#8217;t reference my YesNoType. It my domain, I use plain old booleans. It might be less confusing if I had named this class YesNoMapper. It&#8217;s used for translating the database types, to .NET types.  The .NET type can be anything you want as long as you supply the logic here to translate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Scott</title>
		<link>http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/#comment-21</link>
		<dc:creator>Ken Scott</dc:creator>
		<pubDate>Sun, 23 Mar 2008 14:32:11 +0000</pubDate>
		<guid isPermaLink="false">/blogs/rhouston/archive/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype.aspx#comment-21</guid>
		<description>Once you have created this user type and reference it in your Domain model, is there any way to not have a reference to NHibernate in the Domain model?

I&#039;ve done something similar (created a user type for the version column to allow mapping of a SQL Server rowversion column to something other than Byte[]). It works fine, but I feel &quot;dirty&quot; seeing that reference to NHibernate in the model.

Do I need to just get over it?

Thanks,
Ken Scott</description>
		<content:encoded><![CDATA[<p>Once you have created this user type and reference it in your Domain model, is there any way to not have a reference to NHibernate in the Domain model?</p>
<p>I&#8217;ve done something similar (created a user type for the version column to allow mapping of a SQL Server rowversion column to something other than Byte[]). It works fine, but I feel &#8220;dirty&#8221; seeing that reference to NHibernate in the model.</p>
<p>Do I need to just get over it?</p>
<p>Thanks,<br />
Ken Scott</p>
]]></content:encoded>
	</item>
</channel>
</rss>
