ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Bayon <ibatis....@gmail.com>
Subject Re: Ibatis 1.3.0 / ODP 10g : NUMBER dbType - Double/Decimal .NET Type
Date Wed, 11 Jan 2006 18:57:03 GMT
Bonjour Nicolas

The best solution is to use a custom type handler that overrides IBatisNet's
DecimalTypeHandler

<typeHandlers>
  <typeHandler
   type="System.Decimal"
   handler="CustomDoubleTypeHanlder" />
</typeHandlers> (in SqlMap.config)

Ron use such a solution to overrides IBatisNet's DateTimeTypeHandler.

Cheers
-Gilles

On 1/11/06, nicolas.theron@bnpparibas.com <nicolas.theron@bnpparibas.com>
wrote:
>
>
> Hi
>
> I am migrating my application from MIcrosoft Oracle Provider
> (System.Data.OracleClient) to ODP 10.0.4  (Oracle.DataAccess). and I
> experiment some problems with NUMBER dbType.
>
> According to the ODP Documentation, NUMBER should be read with the
> OracleDataAdapter.GetDecimal() method and not
> OracleDataAdapter.GetDouble(). With MS Provider, GetDouble works propoerly
>
> Unfortunately, all my C# objects use double type. with MS Provider, I let
> the AutoMapReader map the query result into my object properties. But with
> ODP, it does not work anymore :(  Indeed, The AutoMapReader still use
> GetDouble.
>
> So, Can Ibatis convert decimal to double for me at the mapping step ? Do I
> write a Custom Type Handlers  ? or is the any other solution more clever ?
>
> Obviously, I can replace in my code all double type to Decimal type, and
> add everywhere some Convert.ToDouble to avoid interface modfication but is
> is quite boring.
>
> Regards
>

Mime
View raw message