Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 61130 invoked from network); 5 Jun 2008 08:16:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jun 2008 08:16:09 -0000 Received: (qmail 10056 invoked by uid 500); 5 Jun 2008 08:16:11 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 10040 invoked by uid 500); 5 Jun 2008 08:16:11 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Received: (qmail 10029 invoked by uid 99); 5 Jun 2008 08:16:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 01:16:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 08:15:23 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 218F8234C134 for ; Thu, 5 Jun 2008 01:15:45 -0700 (PDT) Message-ID: <260549270.1212653745136.JavaMail.jira@brutus> Date: Thu, 5 Jun 2008 01:15:45 -0700 (PDT) From: "Guillaume Serre (JIRA)" To: ddlutils-dev@db.apache.org Subject: [jira] Commented: (DDLUTILS-86) New attribute of Column. Native type is a value of TYPE_NAME in the result set of DataBaseMetadata.getColumns(...). In-Reply-To: <1750881279.1143664589883.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DDLUTILS-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602580#action_12602580 ] Guillaume Serre commented on DDLUTILS-86: ----------------------------------------- Hello, I also need this TYPE_NAME column to be retrieved. It is very useful in Oracle to identify NVARCHAR2 columns, which in ddlutils-1.0 are mapped to Types.OTHER. > New attribute of Column. Native type is a value of TYPE_NAME in the result set of DataBaseMetadata.getColumns(...). > ------------------------------------------------------------------------------------------------------------------- > > Key: DDLUTILS-86 > URL: https://issues.apache.org/jira/browse/DDLUTILS-86 > Project: DdlUtils > Issue Type: New Feature > Components: Core (No specific database) > Reporter: Yauheni Prykhodzka > Assignee: Thomas Dudziak > Priority: Minor > Fix For: 1.2 > > > It was been discussing with Thomas Dudziak. We try to use DdlUtils to compare two and more databases. In some cases we need the functionality of JDBC call DataBaseMetadata.getColumns(...). This call returns among other things the native type of the column as well. Sometimes it's different than hard coded predefined types for a platform. This difference is very important if you compare two databases. Here is the begin of my email to Thomas about that problem: > > i'm developing now a small tool that should compare > > databases (of the same type). I need to get native > > types possibly without any modifications. For example > > the base implementation of DdlUtils returns SMALLINT > > instead of TYNIINT for MySql. Probably i can get > > SMALLINT both for TYNIINT and for some other native > > type if i'll use the current implementation of > > DdlUtils. So the result of the compare can be wrong in > > this case! > Here also changes of classes Column and JdbcModelReader. > Column: > 66,68d65 > < > < /** native data type */ > < private String _nativeDataType; > 516,518d512 > < > < // compare native data type > < comparator.append(_nativeDataType, other.getNativeDataType()); > 554c548 > < builder.append(_nativeDataType); > --- > > builder.append(getParsedDefaultValue()); > 560,562d553 > < // native data type > < builder.append(getNativeDataType()); > < > 577,579d567 > < // native data type > < result.append("; native type="); > < result.append(_nativeDataType); > 616,618d603 > < // native data type > < result.append("; native type="); > < result.append(_nativeDataType); > 623,636d607 > < > < /** > < * @return Returns the _nativeDataType. > < */ > < public String getNativeDataType() { > < return _nativeDataType; > < } > < > < /** > < * @param dataType The _nativeDataType to set. > < */ > < public void setNativeDataType(String dataType) { > < _nativeDataType = dataType; > < } > JdbcModelReader: > 184,185d183 > < // native data type > < result.add(new MetaDataColumnDescriptor("TYPE_NAME", Types.VARCHAR)); > 760,763d757 > < > < // native data type > < column.setNativeDataType(((String)values.get("TYPE_NAME")).trim()); > < > Thanx, > Yauheni Prykhodzka -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.