ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "market sniffer" <market.snif...@gmail.com>
Subject ibatis 2.1.7 build #597 value object problem
Date Mon, 21 Apr 2008 08:44:40 GMT
hi:

i try to select from a table with no rows of data and uses the following
resultMap as return

<!-- definitions of another statement which has the following selection-->
....
<result property="mktTotalIncome" column="HDBH"
select="marketing.mktTotalIncome"/>
...

 <select id="mktTotalIncome" parameterClass="java.lang.String"
resultMap="get-mktTotalIncome-result">
  select
   MARKETING_ID,
   INCOME_TOTAL_AIM,
   INCOME_TOTAL_ACTUAL,
   BEFORE_ARPU_THREE,
   BEFORE_ARPU_TWO,
   BEFORE_ARPU_ONE,
   AFTER_ARPU_ONE,
   AFTER_ARPU_TWO,
   AFTER_ARPU_THREE
  from da.TABA_MARKET_TOTAL_INCOME
  where MARKETING_ID = #marketingId#
 </select>

 <resultMap id="get-mktTotalIncome-result" class="MktTotalIncomeVO">
  <result property="marketing_id" column="MARKETING_ID"/>
  <result property="income_total_aim" column="INCOME_TOTAL_AIM"
nullValue="0"/>
  <result property="income_total_actual" column="INCOME_TOTAL_ACTUAL"
nullValue="0"/>
  <result property="before_arpu_three" column="BEFORE_ARPU_THREE"
nullValue="0"/>
  <result property="before_arpu_two" column="BEFORE_ARPU_TWO"
nullValue="0"/>
  <result property="before_arpu_one" column="BEFORE_ARPU_ONE"
nullValue="0"/>
  <result property="after_arpu_one" column="AFTER_ARPU_ONE" nullValue="0"/>
  <result property="after_arpu_two" column="AFTER_ARPU_TWO" nullValue="0"/>
  <result property="after_arpu_three" column="AFTER_ARPU_THREE"
nullValue="0"/>
 </resultMap>

since there is no data, i am expecting the the field "mktTotalIncome" to
return null, however i got the return of a MktTotalIncomeVO with its fields
set to null, and which in turn is causing some of the arithmatic problems.

i am wondering why it does not return NULL  but a new object with fields set
to null?

thanks.

Mime
View raw message