db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yauheni Prykhodzka <yauheni.prykhod...@pinjaworld.de>
Subject Re: a small extension of the class Column
Date Wed, 15 Mar 2006 11:55:34 GMT
Hi Thomas,

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!

I agree with you that isn't a common case. But you
need to know the native type sometimes.


--- Thomas Dudziak <tomdzk@gmail.com> schrieb:

> On 3/15/06, Yauheni Prykhodzka
> <yauheni.prykhodzka@pinjaworld.de> wrote:
> > i did a small extension of your code. i added the
> > attribute for the
> > native data type to the class Column. the native
> type
> > is returned  by a
> > jdbc  driver.  you already use a mapping to return
> the
> > native time
> > calling PlatformInfo.getNativeType(int). my call
> is
> > Column.getNativeDataType(), that returns String.
> jdbc
> > drive (and my
> > call) returns different result that you method of
> > PlatformInfo. it's
> > important if you want to compare databases.
> >
> > so i would like to ask if this is useful for the
> > projekt? if it's so, how can i add my
> > code to the project? how does it work?
> I'm not entirely sure why you need this? In general,
> the jdbc type of
> a column in a model read from a live database is
> almost always the
> type returned by the jdbc driver. Only on some rare
> cases, DdlUtils
> modifies the type in order to enhance the mapping.
> E.g. Oracle does not have TINYINT, SMALLINT or
> BIGINT types, but
> rather you have to use NUMBER with varying size for
> these. On reading
> a model from an Oracle database, DdlUtils checks the
> size (and scale)
> of these columns (which are returned as NUMERIC) and
> if it encounters
> the exact size specification for
> the jdbc type accordingly.
> Tom

Yauheni Prykhodzka
Bussardstr. 16
85716 Unterschleissheim

E-Mail: yauheni.prykhodzka@pinjaworld.de
Tel.:   +49 89 42775646
Handy:  +49 179 6689607
Web:    http://www.pinjaworld.de

View raw message