Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 83172 invoked from network); 27 Nov 2003 19:00:04 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Nov 2003 19:00:04 -0000 Received: (qmail 23901 invoked by uid 500); 27 Nov 2003 18:59:51 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 23714 invoked by uid 500); 27 Nov 2003 18:59:50 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 23696 invoked from network); 27 Nov 2003 18:59:49 -0000 Received: from unknown (HELO relay-2.net4b.pt) (195.245.176.1) by daedalus.apache.org with SMTP; 27 Nov 2003 18:59:49 -0000 Received: (qmail 25676 invoked from network); 27 Nov 2003 18:59:52 +0000 Received: from unknown (HELO smtp-1.net4b.pt) ([10.0.7.1]) (envelope-sender ) by relay-2.lx.esp (qmail-ldap-1.03) with SMTP for ; 27 Nov 2003 18:59:52 +0000 Received: (qmail 10032 invoked from network); 27 Nov 2003 18:59:52 +0000 Received: from unknown (HELO mcmsmtp.mediacapital.pt) ([213.58.141.194]) (envelope-sender ) by smtp-1.lx.esp (qmail-ldap-1.03) with SMTP for ; 27 Nov 2003 18:59:52 +0000 Received: (qmail 8824 invoked from network); 27 Nov 2003 18:58:25 -0000 Received: from localhost (HELO mcmsmtp.mediacapital.pt) (127.0.0.1) by localhost with SMTP; 27 Nov 2003 18:58:25 -0000 Received: (qmail 8821 invoked from network); 27 Nov 2003 18:58:25 -0000 Received: from mcmcluster1.mediacapital.pt (HELO mcmvs1.mediacapital.pt) (10.83.0.250) by mcmdns2.mediacapital.pt with SMTP; 27 Nov 2003 18:58:25 -0000 Received: from mediacapital.pt ([10.83.3.43]) by mcmvs1.mediacapital.pt with Microsoft SMTPSVC(5.0.2195.6713); Thu, 27 Nov 2003 18:59:50 +0000 Message-ID: <3FC649A6.5060202@mediacapital.pt> Date: Thu, 27 Nov 2003 18:59:50 +0000 From: =?ISO-8859-1?Q?=22Jos=E9_Fortunato_H=2E_Tom=E1s=22?= Organization: IST User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en, pt MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: Commons-dbutils: Setter for Oracle DB Table of type NUMBER isn't called References: <20031127182624.6261.qmail@web20703.mail.yahoo.com> In-Reply-To: <20031127182624.6261.qmail@web20703.mail.yahoo.com> Content-Type: multipart/alternative; boundary="------------020605090507050904050609" X-OriginalArrivalTime: 27 Nov 2003 18:59:50.0629 (UTC) FILETIME=[A27A9150:01C3B518] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --------------020605090507050904050609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Tnx for the answer. About the CC mail i'll no repeat! Seriously! Tnx! David Graham wrote: >--- "Jos�_Fortunato_H._Tom�s" wrote: > > >>I have the following problem: >> Bean setter for an Oracle DB table's collumn of type NUMBER isn't >>called. >> >>To parcially solve I had to use to_char SQL directive: >>---> >> QueryRunner run = new QueryRunner( >>GcfServiceLocator.getInstance().getDataSourceForGCF() ); >> BeanListHandler bh = new BeanListHandler( >>CustomerValueObject.class ); >> Object[] args = {( "%" + name + "%" ).replaceAll( "\\s", "%" >> >>).replaceAll( "%{2,}", "%" )}; >> query = "select" + >> " to_char(CUSTOMER_ID) customerId" + >> ", CUSTOMER_NAME name" + >> ", BILL_CYCLE billCycle" + >> ", to_char(CUSTOMER_TYPE) customerType" + >> ", STATUS state" + >> ", GTP_FLAG gtpFlag" + >> ", CREATE_DATE createDate" + >> ", CREATED_BY createdBy" + >> ", MODIFICATION_DATE modificationDate" + >> ", MODIFIED_BY modifiedBy" + >> " from CUSTOMER" + >> " where" + >> " CUSTOMER_NAME LIKE ?1" >> ; >> logger.debug( "getCustomerListByName(" + query + ")" ); >> ret = (ArrayList)run.query( >> query >> , args >> , bh >> ); >><--- >> >> > >First, do not cross post messages to commons-dev and commons-user and do >not copy individuals on the message. I received this message 3 times! >This should have only been posted to commons-user. > >Do not cast the result from run.query() to an ArrayList; BeanListHandler's >API states that a List is returned and we could change it to a different >implementation at any time. > > > >>I looked into the source, but for lack of time I could't found the >>correct place that maps props types and collunms between setters for >>lookup method by reflection. >> >> > >BasicRowProcessor is the class to look at. It's javadoc says how it maps >columns to properties: >http://jakarta.apache.org/commons/dbutils/apidocs/org/apache/commons/dbutils/BasicRowProcessor.html#toBean(java.sql.ResultSet,%20java.lang.Class) > > > > >>Is there a known issue ? What can I do? >>Is there any code that I can aplly? >>Or can you give-me an indication into the source so I contribute fastly? >> >> > >You have a couple of options: >1. Implement your own RowProcessor >2. Have the BasicRowProcessor set all of the properties it can and you >set the rest manually. > >FYI, there is discussion on commons-dev about a new interface that allows >specialized type conversion. > >David > > > >>Thanks! >>-- >> >>__________________________________________________ >> >>Jos� Fortunato Tom�s >> >>*Mediacapital** Telecomunica��es - IOL* >> >>Rua M�rio Castelhano n� 40 >> >>2749-502 BARCARENA >> >> >> >>Ext.: 12733 >> >>Telef.: 21 434 59 33 >> >>Fax.: 21 434 63 88 >> >> >> >> >> >> > > >__________________________________ >Do you Yahoo!? >Free Pop-Up Blocker - Get it now >http://companion.yahoo.com/ > >--------------------------------------------------------------------- >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > -- __________________________________________________ Jos� Fortunato Tom�s *Mediacapital** Telecomunica��es - IOL* Rua M�rio Castelhano n� 40 2749-502 BARCARENA Ext.: 12733 Telef.: 21 434 59 33 Fax.: 21 434 63 88 --------------020605090507050904050609--