Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 78023 invoked from network); 8 Mar 2006 15:03:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Mar 2006 15:03:32 -0000 Received: (qmail 86438 invoked by uid 500); 8 Mar 2006 15:03:30 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 86404 invoked by uid 500); 8 Mar 2006 15:03:30 -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 86395 invoked by uid 99); 8 Mar 2006 15:03:30 -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 07:03:30 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.198.207] (HELO smtp108.sbc.mail.mud.yahoo.com) (68.142.198.207) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Mar 2006 07:03:29 -0800 Received: (qmail 66943 invoked from network); 8 Mar 2006 15:03:08 -0000 Received: from unknown (HELO ?127.0.0.1?) (ddebrunner@sbcglobal.net@71.132.1.45 with plain) by smtp108.sbc.mail.mud.yahoo.com with SMTP; 8 Mar 2006 15:03:08 -0000 Message-ID: <440EF21A.7090909@apache.org> Date: Wed, 08 Mar 2006 07:02:50 -0800 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en, de MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: A question about types References: <440D9F47.40503@apache.org> In-Reply-To: X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dyre.Tjeldvoll@Sun.COM wrote: > 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? You could use the code I showed the other day that created a DataTypeDesciptor out from a catalog TypeDescriptor. Dan.