db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <tfisc...@apache.org>
Subject Re: Customisation of jdbc->sql type mapping
Date Sun, 13 Aug 2006 08:57:10 GMT
On Mon, 7 Aug 2006, Thomas Dudziak wrote:

> On 8/5/06, Thomas Fischer <tfischer@apache.org> wrote:
>
>> Is there any support planned for customisation the mapping from jdbc types
>> to sql types ? For example, users might want to use nvarchar2 instead of
>> varchar for some reason.
>
> yep, that is one of the core features planned for the 1.1 release.
> Basically, there are planned to be three levels of customization:
>
> - for the Ant task invocation, so that the mapping applies to all
> schema files handled by this task run
>
> - for a schema file
>
> - for a specific column
>
> the general idea is to have declarative (XML) and programmatic control
> to e.g. map every occurrence of VARCHAR (JDBC type) to NVARCHAR2
> (Oracle type) regardless of length, or also for specific lengths.

ok, as it is in 1.1. you probably do not have an idea what the xml (you 
mean schema.xml here, I assume ? ) part would look like :-(

>> My current plan for Torque is to use the "domain" attribute in the torque
>> schema file. A domain (I'm not finding this name intuitive, maybe there's
>> a better one) is a kind of "custom column type" the user can define. For
>> example, the user can define a type "SHORTVARCHAR" which corresponds to a
>> varchar column with size 20. The user then can use the type "shortvarchar"
>> as column type in the schema, and does not need to specify the size of 20
>> everywhere.
>
> hmm, this is somewhat different to the above as it basically means
> that a filter is applied between reading the schema from XML and
> applying the model (e.g. writing it to the DB).
> This can surely be done but might perhaps make more sense in a Torque
> derived XML schema ? I'm not too sure yet, but since it would not be
> difficult to implement, we can just as well have it in DdlUtils.
> This would however be different from support DOMAINs in the database
> as these apply to the native type instead.

Probably you are right, on should not misuse domains for that, if they 
exist in databases and they cannot support this.

    Thomas

Mime
View raw message