Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 50555 invoked from network); 8 Mar 2006 14:28:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Mar 2006 14:28:43 -0000 Received: (qmail 17909 invoked by uid 500); 8 Mar 2006 14:28:39 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 17869 invoked by uid 500); 8 Mar 2006 14:28:38 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 17860 invoked by uid 99); 8 Mar 2006 14:28:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 06:28:38 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.34] (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 06:28:37 -0800 Received: from phys-epost-1 ([129.159.136.14]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id k28ESGQj002278 for ; Wed, 8 Mar 2006 07:28:16 -0700 (MST) Received: from conversion-daemon.epost-mail1.sweden.sun.com by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IVT00M01BSVCW@epost-mail1.sweden.sun.com> (original mail from Dyre.Tjeldvoll@Sun.COM) for derby-dev@db.apache.org; Wed, 08 Mar 2006 15:28:15 +0100 (MET) Received: from khepri29.sun.com (khepri29.Norway.Sun.COM [129.159.112.241]) by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IVT00JYRC73KO@epost-mail1.sweden.sun.com> for derby-dev@db.apache.org; Wed, 08 Mar 2006 15:28:15 +0100 (MET) Date: Wed, 08 Mar 2006 15:28:15 +0100 From: Dyre.Tjeldvoll@Sun.COM Subject: Re: A question about types In-reply-to: <440D9F47.40503@apache.org> To: derby-dev@db.apache.org Message-id: MIME-version: 1.0 Content-type: text/plain; charset=us-ascii User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (usg-unix-v) References: <440D9F47.40503@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Daniel John Debrunner writes: > TypeDescriptor represents a type in the catalogs, it's best to create an > instance of the runtime type descriptor DataTypeDescriptor from it. > > TypeDescriptor td; // get from array/method > > // TypeId represents the fixed aspect of a type, without > // nullability or any length attributes. > TypeId typeId = TypeId.getBuiltInTypeId(td.getJDBCTypeId()); > > DataTypeDescriptor dtd = new DataTypeDescriptor(typeId, > td.getPrecision(), td.getScale(), td.isNullable(), td.getMaximumWidth()); Hmm, if I read the javadoc correctly it seems like both DataTypeDescriptor and TypeDescriptorImpl (which both implement the TypeDescriptor interface) already have a TypeId member variable, and an accessor method called getTypeId(). Unfortunately, this method in NOT part of the TypeDescriptor interface, so the only way to get at it is to downcast the TypeDescriptor :( Would it be bad to add getTypeId() to the TypeDescriptor interface? -- dt