ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Henrique Ferreira e Silva <dhsi...@gmail.com>
Subject Re: QueryForObject returns wrong data
Date Wed, 27 Jul 2005 17:10:56 GMT
Shilpa,

That is exactly the point Larry tried to show you. As your BigDecimal
has scale 0, it shows you only the integer part of the value. Set it
to 2, for example, in your setter:

public void setMyBigDecimalProperty(BigDecimal val) {
     this.myBigDecimalProperty = val;
     this.myBigDecimalProperty.setScale(2);
}

Apparently, that will solve your issue.
Let me know what you get doing that.

Cheers,
Daniel Silva.


On 7/27/05, shilpa <shilpa.pradhan@judiciary.state.nj.us> wrote:
> Larry Meadors <larry.meadors <at> gmail.com> writes:
> 
> >
> > What I mean is if you set the scale on the object, is the real value there?
> > yourBigDecimal.setScale(2);
> > Larry
> 
> 
> I am geting only 99 from iBatis, not 99.11
> I am printing what I am getting in set method of value object, and its showing
> me just 99. I called scale() method on BigDecimal object returned by iBatis,
> and its giving me '0'.
> 
> What could be the problem?
> 
> Lot of other people at my work place is also facing the same problem.
> 
> Can anyone help us regarding this?
> 
> Thanks,
> Shilpa
> 
> 
> 
> 
>

Mime
View raw message