<?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: iBatis &#8211; Mapping Database NULL</title>
	<atom:link href="http://whatwouldnickdo.com/wordpress/491/ibatis-mapping-database-null/feed/" rel="self" type="application/rss+xml" />
	<link>http://whatwouldnickdo.com/wordpress/491/ibatis-mapping-database-null/</link>
	<description>Discussions on Programming, Linux, and whatever else.</description>
	<lastBuildDate>Tue, 27 Jul 2010 12:00:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Kambiz</title>
		<link>http://whatwouldnickdo.com/wordpress/491/ibatis-mapping-database-null/comment-page-1/#comment-585</link>
		<dc:creator>Kambiz</dc:creator>
		<pubDate>Fri, 05 Jun 2009 16:09:42 +0000</pubDate>
		<guid isPermaLink="false">http://whatwouldnickdo.com/wordpress/?p=491#comment-585</guid>
		<description>you could also modify the sql statement to get default values instead of null.

SELECT CASE
         WHEN passwordExpired IS NULL THEN false
         ELSE passwordExpired 
       END
FROM Employee;</description>
		<content:encoded><![CDATA[<p>you could also modify the sql statement to get default values instead of null.</p>
<p>SELECT CASE<br />
         WHEN passwordExpired IS NULL THEN false<br />
         ELSE passwordExpired<br />
       END<br />
FROM Employee;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://whatwouldnickdo.com/wordpress/491/ibatis-mapping-database-null/comment-page-1/#comment-229</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 30 Mar 2009 20:41:26 +0000</pubDate>
		<guid isPermaLink="false">http://whatwouldnickdo.com/wordpress/?p=491#comment-229</guid>
		<description>Thanks for the comments.
Yes, using objects is another option although I&#039;m not convinced the best.  Of course it really depends on your database and design.  Having an old legacy database where anything goes as far as type checking and so on, then I agree that objects may be a slightly more useful (not better) option.</description>
		<content:encoded><![CDATA[<p>Thanks for the comments.<br />
Yes, using objects is another option although I&#8217;m not convinced the best.  Of course it really depends on your database and design.  Having an old legacy database where anything goes as far as type checking and so on, then I agree that objects may be a slightly more useful (not better) option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Developer Dude</title>
		<link>http://whatwouldnickdo.com/wordpress/491/ibatis-mapping-database-null/comment-page-1/#comment-228</link>
		<dc:creator>Developer Dude</dc:creator>
		<pubDate>Mon, 30 Mar 2009 19:28:13 +0000</pubDate>
		<guid isPermaLink="false">http://whatwouldnickdo.com/wordpress/?p=491#comment-228</guid>
		<description>Like Mauli, I would choose objects over primitives too because often a null value does have some meaning in an app (*gasp* - yeah, yeah, I know, it is heresy, but this is the real world after all, and even Date said null means the value is unknown - IIRC).

However, it is good to know that you can set a default value in the mapping (regardless of whether you are mapping to an object or primitive) if that is what you need to do. You often don&#039;t have control over a database/schema/data, and sometimes you don&#039;t have control over a POJO either, so it is always nice to have the options and know how to use them. 

Thanks for the tip, I don&#039;t remember whether I knew this before or not because while I use iBatis as my preferred method of mapping POJOs to SQL and vice versa, I spend most of my time in the biz logic and not the persistence/query logic.</description>
		<content:encoded><![CDATA[<p>Like Mauli, I would choose objects over primitives too because often a null value does have some meaning in an app (*gasp* &#8211; yeah, yeah, I know, it is heresy, but this is the real world after all, and even Date said null means the value is unknown &#8211; IIRC).</p>
<p>However, it is good to know that you can set a default value in the mapping (regardless of whether you are mapping to an object or primitive) if that is what you need to do. You often don&#8217;t have control over a database/schema/data, and sometimes you don&#8217;t have control over a POJO either, so it is always nice to have the options and know how to use them. </p>
<p>Thanks for the tip, I don&#8217;t remember whether I knew this before or not because while I use iBatis as my preferred method of mapping POJOs to SQL and vice versa, I spend most of my time in the biz logic and not the persistence/query logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mauli</title>
		<link>http://whatwouldnickdo.com/wordpress/491/ibatis-mapping-database-null/comment-page-1/#comment-224</link>
		<dc:creator>Mauli</dc:creator>
		<pubDate>Mon, 30 Mar 2009 06:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://whatwouldnickdo.com/wordpress/?p=491#comment-224</guid>
		<description>Why don&#039;t you use Integer Objects instead of primitive types? That way your columns can have null without a problem. That is my definite aproach for enterprise apps, because there are always such problems. A different approach could be that you create setters which would set a default value in case of null.</description>
		<content:encoded><![CDATA[<p>Why don&#8217;t you use Integer Objects instead of primitive types? That way your columns can have null without a problem. That is my definite aproach for enterprise apps, because there are always such problems. A different approach could be that you create setters which would set a default value in case of null.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
