You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Toshiaki Takashima <ta...@jp.fujitsu.com> on 2006/01/27 17:44:44 UTC

TypeHandler for java primitive

Hi,



 You know, when you set resultClass properties to java primitive type
such as "int", NullPointerException occures if its corresponding Table
Column value is null.

 You can suppress those Exception by setting "nullValue" property to
each column in SQL Map xml. But, it is very messy work.

 So, I want to set TypeHandler for int type property in SQL Map Config.
But my attempt failed. I'm sorry but TypeHandler for java primitive type
doesn't work.

 Is it a bug or iBATIS policy?



 thanks,


---------------------------------------------------------
第二ソリューションビジネス統括部・第一ソリューション部

高島俊昭
mailto:taka-t@jp.fujitsu.com
内線  :7576-4407

株式会社富山富士通
〒939-2392 富山県婦負郡八尾町保内2-2-1
TEL 076-455-3131
FAX 076-455-0935
---------------------------------------------------------



Re: TypeHandler for java primitive

Posted by Larry Meadors <lm...@apache.org>.
Messier than mapping a null value to a variable that cannot contain null values?

I have to disagree.

Larry


On 1/27/06, Toshiaki Takashima <ta...@jp.fujitsu.com> wrote:
> hi,
>
> > Why not just use Integer?
>
>
> I think it is a little bit messy
> to calculate the numeric property
> when you use Integer because you
> have to use Integer.intValue method.
>
>
> Don't you think so?
>
>
>
>
>
> > Why not just use Integer?
> >
> > Larry
> >
> >
> > On 1/27/06, Toshiaki Takashima <ta...@jp.fujitsu.com> wrote:
> > > Hi,
> > >
> > >
> > >
> > >  You know, when you set resultClass properties to java primitive type
> > > such as "int", NullPointerException occures if its corresponding Table
> > > Column value is null.
> > >
> > >  You can suppress those Exception by setting "nullValue" property to
> > > each column in SQL Map xml. But, it is very messy work.
> > >
> > >  So, I want to set TypeHandler for int type property in SQL Map Config.
> > > But my attempt failed. I'm sorry but TypeHandler for java primitive type
> > > doesn't work.
> > >
> > >  Is it a bug or iBATIS policy?
> > >
> > >
> > >
> > >  thanks,
> > >
> > >
> > > ---------------------------------------------------------
> > > 第二ソリューションビジネス統括部・第一ソリューション部
> > >
> > > 高島俊昭
> > > mailto:taka-t@jp.fujitsu.com
> > > 内線  :7576-4407
> > >
> > > 株式会社富山富士通
> > > 〒939-2392 富山県婦負郡八尾町保内2-2-1
> > > TEL 076-455-3131
> > > FAX 076-455-0935
> > > ---------------------------------------------------------
> > >
> > >
> > >
>
>
> ---------------------------------------------------------
> 第二ソリューションビジネス統括部・第一ソリューション部
>
> 高島俊昭
> mailto:taka-t@jp.fujitsu.com
> 内線  :7576-4407
>
> 株式会社富山富士通
> 〒939-2392 富山県婦負郡八尾町保内2-2-1
> TEL 076-455-3131
> FAX 076-455-0935
> ---------------------------------------------------------
>
>
>

Re: TypeHandler for java primitive

Posted by Toshiaki Takashima <ta...@jp.fujitsu.com>.
hi,

> Why not just use Integer?


I think it is a little bit messy 
to calculate the numeric property 
when you use Integer because you 
have to use Integer.intValue method.


Don't you think so?





> Why not just use Integer?
> 
> Larry
> 
> 
> On 1/27/06, Toshiaki Takashima <ta...@jp.fujitsu.com> wrote:
> > Hi,
> >
> >
> >
> >  You know, when you set resultClass properties to java primitive type
> > such as "int", NullPointerException occures if its corresponding Table
> > Column value is null.
> >
> >  You can suppress those Exception by setting "nullValue" property to
> > each column in SQL Map xml. But, it is very messy work.
> >
> >  So, I want to set TypeHandler for int type property in SQL Map Config.
> > But my attempt failed. I'm sorry but TypeHandler for java primitive type
> > doesn't work.
> >
> >  Is it a bug or iBATIS policy?
> >
> >
> >
> >  thanks,
> >
> >
> > ---------------------------------------------------------
> > 第二ソリューションビジネス統括部・第一ソリューション部
> >
> > 高島俊昭
> > mailto:taka-t@jp.fujitsu.com
> > 内線  :7576-4407
> >
> > 株式会社富山富士通
> > 〒939-2392 富山県婦負郡八尾町保内2-2-1
> > TEL 076-455-3131
> > FAX 076-455-0935
> > ---------------------------------------------------------
> >
> >
> >


---------------------------------------------------------
第二ソリューションビジネス統括部・第一ソリューション部

高島俊昭
mailto:taka-t@jp.fujitsu.com
内線  :7576-4407

株式会社富山富士通
〒939-2392 富山県婦負郡八尾町保内2-2-1
TEL 076-455-3131
FAX 076-455-0935
---------------------------------------------------------



Re: TypeHandler for java primitive

Posted by Larry Meadors <lm...@apache.org>.
Why not just use Integer?

Larry


On 1/27/06, Toshiaki Takashima <ta...@jp.fujitsu.com> wrote:
> Hi,
>
>
>
>  You know, when you set resultClass properties to java primitive type
> such as "int", NullPointerException occures if its corresponding Table
> Column value is null.
>
>  You can suppress those Exception by setting "nullValue" property to
> each column in SQL Map xml. But, it is very messy work.
>
>  So, I want to set TypeHandler for int type property in SQL Map Config.
> But my attempt failed. I'm sorry but TypeHandler for java primitive type
> doesn't work.
>
>  Is it a bug or iBATIS policy?
>
>
>
>  thanks,
>
>
> ---------------------------------------------------------
> 第二ソリューションビジネス統括部・第一ソリューション部
>
> 高島俊昭
> mailto:taka-t@jp.fujitsu.com
> 内線  :7576-4407
>
> 株式会社富山富士通
> 〒939-2392 富山県婦負郡八尾町保内2-2-1
> TEL 076-455-3131
> FAX 076-455-0935
> ---------------------------------------------------------
>
>
>