Daniel John Debrunner <[EMAIL PROTECTED]> 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
