ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Zatko <mza...@boscovs.com>
Subject Integer to Boolean conversion is opposite from expected behavior
Date Fri, 25 Mar 2005 15:20:46 GMT
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