Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 62384 invoked from network); 14 Jul 2004 18:25:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Jul 2004 18:25:04 -0000 Received: (qmail 81064 invoked by uid 500); 14 Jul 2004 18:25:01 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 80783 invoked by uid 500); 14 Jul 2004 18:24:59 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 80768 invoked by uid 99); 14 Jul 2004 18:24:59 -0000 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received: from [206.190.38.244] (HELO web50409.mail.yahoo.com) (206.190.38.244) by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 14 Jul 2004 11:24:55 -0700 Message-ID: <20040714182454.19243.qmail@web50409.mail.yahoo.com> Received: from [66.80.49.7] by web50409.mail.yahoo.com via HTTP; Wed, 14 Jul 2004 11:24:54 PDT Date: Wed, 14 Jul 2004 11:24:54 -0700 (PDT) From: David Graham Subject: Re: [PATCH] DBUtils : workaround for Oracle NUMBER datatype To: Jakarta Commons Developers List In-Reply-To: <2c494a73040714105278efbb25@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Download a recent nightly build. This problem has already been fixed. David --- John Pederzolli wrote: > This patch allows the object get/set datatypes to be float, double, or > int (if possible). The current codebase requires get/set datatypes to > be BigDecimal. > > Index: BasicRowProcessor.java > =================================================================== > RCS file: > /home/cvspublic/jakarta-commons/dbutils/src/java/org/apache/commons/dbutils/BasicRowProcessor.java,v > retrieving revision 1.10 > diff -r1.10 BasicRowProcessor.java > 2c2,58 > < * Copyright 2002-2004 The Apache Software Foundation > --- > > * $Header: > /home/cvs/jakarta-commons/dbutils/src/java/org/apache/commons/dbutils/BasicRowProcessor.java,v > 1.5 2003/11/11 00:53:19 dgraham Exp $ > > * $Revision: 1.5 $ > > * $Date: 2003/11/11 00:53:19 $ > > * > > * > ==================================================================== > > * > > * The Apache Software License, Version 1.1 > > * > > * Copyright (c) 2002-2003 The Apache Software Foundation. All rights > > * reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > * modification, are permitted provided that the following conditions > > * are met: > > * > > * 1. Redistributions of source code must retain the above copyright > > * notice, this list of conditions and the following disclaimer. > > * > > * 2. Redistributions in binary form must reproduce the above > copyright > > * notice, this list of conditions and the following disclaimer in > > * the documentation and/or other materials provided with the > > * distribution. > > * > > * 3. The end-user documentation included with the redistribution, if > > * any, must include the following acknowledgement: > > * "This product includes software developed by the > > * Apache Software Foundation (http://www.apache.org/)." > > * Alternately, this acknowledgement may appear in the software > itself, > > * if and wherever such third-party acknowledgements normally > appear. > > * > > * 4. The names "The Jakarta Project", "Commons", and "Apache Software > > * Foundation" must not be used to endorse or promote products > derived > > * from this software without prior written permission. For written > > * permission, please contact apache@apache.org. > > * > > * 5. Products derived from this software may not be called "Apache" > > * nor may "Apache" appear in their names without prior written > > * permission of the Apache Software Foundation. > > * > > * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED > > * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > > * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > > * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR > > * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > > * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > > * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > > * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > > * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > > * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT > > * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > > * SUCH DAMAGE. > > * > ==================================================================== > > * > > * This software consists of voluntary contributions made by many > > * individuals on behalf of the Apache Software Foundation. For more > > * information on the Apache Software Foundation, please see > > * . > 4,14d59 > < * Licensed under the Apache License, Version 2.0 (the "License"); > < * you may not use this file except in compliance with the License. > < * You may obtain a copy of the License at > < * > < * http://www.apache.org/licenses/LICENSE-2.0 > < * > < * Unless required by applicable law or agreed to in writing, software > < * distributed under the License is distributed on an "AS IS" BASIS, > < * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > implied. > < * See the License for the specific language governing permissions and > < * limitations under the License. > 15a61 > > > 17a64,69 > > import java.beans.BeanInfo; > > import java.beans.IntrospectionException; > > import java.beans.Introspector; > > import java.beans.PropertyDescriptor; > > import java.lang.reflect.InvocationTargetException; > > import java.lang.reflect.Method; > 20a73 > > import java.util.ArrayList; > 24a78 > > import java.math.BigDecimal; > 28,32c82,83 > < * > < *

> < * This class is thread-safe. > < *

> < * > --- > > * This class is a thread-safe Singleton. > > * > 33a85,89 > > * > > * @author Henri Yandell > > * @author Juozas Baliuka > > * @author David Graham > > * @author Yoav Shapira > 38,39c94,113 > < * The default BeanProcessor instance to use if not supplied in > the > < * constructor. > --- > > * Set a bean's primitive properties to these defaults when SQL > NULL > > * is returned. These are the same as the defaults that ResultSet > get* > > * methods return in the event of a NULL column. > > */ > > private static final Map primitiveDefaults = new HashMap(); > > > > static { > > primitiveDefaults.put(Integer.TYPE, new Integer(0)); > > primitiveDefaults.put(Short.TYPE, new Short((short) 0)); > > primitiveDefaults.put(Byte.TYPE, new Byte((byte) 0)); > > primitiveDefaults.put(Float.TYPE, new Float(0)); > > primitiveDefaults.put(Double.TYPE, new Double(0)); > > primitiveDefaults.put(Long.TYPE, new Long(0)); > > primitiveDefaults.put(Boolean.TYPE, Boolean.FALSE); > > primitiveDefaults.put(Character.TYPE, new > Character('\u0000')); > > } > > > > /** > > * Special array index that indicates there is no bean property > that > > * matches a column from a ResultSet. > 41c115 > < private static final BeanProcessor defaultConvert = new > BeanProcessor(); > --- > > private static final int PROPERTY_NOT_FOUND = -1; > 52,53d125 > < * @deprecated Create instances with the constructors instead. > This will > < * be removed after DbUtils 1.1. > 60,76c132 > < * Use this to process beans. > < */ > < private BeanProcessor convert = null; > < > < /** > < * BasicRowProcessor constructor. Bean processing defaults to a > < * BeanProcessor instance. > < */ > < public BasicRowProcessor() { > < this(defaultConvert); > < } > < > < /** > < * BasicRowProcessor constructor. > < * @param convert The BeanProcessor to use when converting columns > to > < * bean properties. > < * @since DbUtils 1.1 > --- > > * Protected constructor for BasicRowProcessor subclasses only. > 78c134 > < public BasicRowProcessor(BeanProcessor convert) { > --- > > protected BasicRowProcessor() { > 80d135 > < this.convert = convert; > 85c140 > < * This implementation copies column values into the array in the > same > --- > > * This implementation copies column values into the array in the > same > 104,106c159,183 > < * Convert a ResultSet row into a JavaBean. This > < * implementation delegates to a BeanProcessor instance. > < * @see > org.apache.commons.dbutils.BeanProcessor#toBean(java.sql.ResultSet, > java.lang.Class) > --- > > * Convert a ResultSet row into a JavaBean. This > > * implementation uses reflection and BeanInfo > classes to > > * match column names to bean property names. Properties are > matched to > > * columns based on several factors: > > *
> > *
    > === message truncated ===> --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org