[ http://issues.apache.org/jira/browse/DDLUTILS-86?page=all ]

Thomas Dudziak updated DDLUTILS-86:
-----------------------------------

    Fix Version: 1.1

> New attribute of Column. Native type is a value of TYPE_NAME in the result 
> set of DataBaseMetadata.getColumns(...).
> -------------------------------------------------------------------------------------------------------------------
>
>          Key: DDLUTILS-86
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-86
>      Project: DdlUtils
>         Type: New Feature

>   Components: Core
>     Reporter: Yauheni Prykhodzka
>     Assignee: Thomas Dudziak
>     Priority: Minor
>      Fix For: 1.1

>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to