ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karen Koch <kmk...@sbcglobal.net>
Subject Re: Integer to Boolean conversion is opposite from expected behavior
Date Fri, 25 Mar 2005 15:34:35 GMT
Having 0 = true seems to me to be the opposite of what I would ever expect...

--- Mike Zatko <mzatko@boscovs.com> wrote:
> I have a db table that has a field that has a SMALLINT datatype. This 
> field is being used as a true/false flag. 0 would be true, anything else 
> would be false as would typically happen in C. I set up a result map 
> that looks like the following:
> 
>     <resultMap id="getBenefitAppliesMap" 
> class="com.boscovs.commerce.promotion.dao.benefit.apply.BenefitApplyDAO">
>         <result property="totalOrderOn" column="TOTAL_ORDER_ON" 
> jdbcType="SMALLINT" javaType="java.lang.Boolean" nullValue="false"/>
>     </resultMap>
> 
> I was thrilled that it worked, but the results were opposite of what I 
> expected. A '0' value would denote false, while anything else was true. 
> Anybody know whats going on?
> 
> -- 
> Michael H. Zatko
> Java Enterprise Developer
> Boscov's Information Services
> Work: 610-929-7317
> Home: 610-376-1624
> Page: 610-736-4460
> 
> 

Mime
View raw message