Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 78200 invoked from network); 11 Jan 2006 21:26:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jan 2006 21:26:22 -0000 Received: (qmail 63925 invoked by uid 500); 11 Jan 2006 21:26:21 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 63898 invoked by uid 500); 11 Jan 2006 21:26:21 -0000 Mailing-List: contact user-cs-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-cs@ibatis.apache.org Delivered-To: mailing list user-cs@ibatis.apache.org Received: (qmail 63887 invoked by uid 99); 11 Jan 2006 21:26:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2006 13:26:20 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ibatis.net@gmail.com designates 64.233.182.196 as permitted sender) Received: from [64.233.182.196] (HELO nproxy.gmail.com) (64.233.182.196) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2006 13:26:18 -0800 Received: by nproxy.gmail.com with SMTP id x4so161985nfb for ; Wed, 11 Jan 2006 13:25:57 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=AipnpnkLKbM91M1iyjTWBicCimSk+3vFe0m3v0NZm0/Hzzrqk5xQ0sF9ECEHfCcfUo6ahch5qOIK1S2kAtE/uki0DplzGy743s4Do+fMBVzOLOGxUs1TRiJtRwDeDXYTIxTAf7rShkq3dhC6jzFyDhsjMiMyltqjQVCZ7sLP4j0= Received: by 10.49.27.6 with SMTP id e6mr73886nfj; Wed, 11 Jan 2006 10:57:03 -0800 (PST) Received: by 10.48.255.4 with HTTP; Wed, 11 Jan 2006 10:57:02 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2006 19:57:03 +0100 From: Gilles Bayon To: user-cs@ibatis.apache.org Subject: Re: Ibatis 1.3.0 / ODP 10g : NUMBER dbType - Double/Decimal .NET Type In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2571_31095984.1137005823004" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2571_31095984.1137005823004 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Bonjour Nicolas The best solution is to use a custom type handler that overrides IBatisNet'= s DecimalTypeHandler (in SqlMap.config) Ron use such a solution to overrides IBatisNet's DateTimeTypeHandler. Cheers -Gilles On 1/11/06, 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 propoerl= y > > Unfortunately, all my C# objects use double type. with MS Provider, I let > the AutoMapReader map the query result into my object properties. But wit= h > 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 i= s > is quite boring. > > Regards > ------=_Part_2571_31095984.1137005823004 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Bonjour Nicolas
 
The best solution is to use a custom type handler that overrides = IBatisNet's DecimalTypeHandler
 
<typeHandlers>
  <typeHandler
   type=3D= "System.Decimal"
   handler=3D"CustomDoubleTyp= eHanlder" />
</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.th= eron@bnpparibas.com > wrote:

Hi

I am migrating my = application from MIcrosoft Oracle Provider
(System.Data.OracleClient) to= ODP=20 10.0.4  (Oracle.DataAccess). and I
experiment some problems wi= th NUMBER dbType.

According to the ODP Documentation, NUMBER should = be read with the
OracleDataAdapter.GetDecimal() method and not
Oracle= DataAdapter.GetDouble (). With MS Provider, GetDouble works propoerly

Unfortunately, all m= y 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 no= t work anymore :(  Indeed, The AutoMapReader still use
GetDouble.

So, Can Ibatis convert decimal to double for me at th= e mapping step ? Do I
write a Custom Type Handlers  ? or is th= e any other solution more clever ?

Obviously, I can replace in my co= de all double type to Decimal type, and
add everywhere some Convert.ToDouble to avoid interface modfication but= is
is quite boring.

Regards

------=_Part_2571_31095984.1137005823004--