[ http://jira.andromda.org/browse/CORE-95?page=comments#action_12266 ]
     
Tomasz Bech commented on CORE-95:
---------------------------------

I use andromda_persistence_column_length tagged value, but the length has 
impact on the type.
So to avoid clumsy string sub-typing (based on length) I would prefer to 
configure it as I presented it in the starting topic. For now I do 
some-hardcoded handling in vm template:
sql-type="#handleLongStringType($sourceEnd.sqlType $sourceEnd.columnLength)"
and #handleLongStringType chooses RIGHT sql-type based on sqlType and 
columnLength as I described before.

> Better handling short, long, very long String types per DB type
> ---------------------------------------------------------------
>
>          Key: CORE-95
>          URL: http://jira.andromda.org/browse/CORE-95
>      Project: AndroMDA Core
>         Type: Improvement
>     Reporter: Tomasz Bech
>     Assignee: Chad Brandon

>
> Different databases have different support for the varchar type. For example:
> Oracle: VARCHAR to 4000, longer texts must be as CLOB
> Informix: VARCHAR to 254, longer texts as CLOB or TEXT or LVARCHAR.
> But currently there is no way to have one model and several mapping for DB as 
> there is no conditional mapping in Mapping file.
> It would be nice to achieve:
>     <mapping>
>         <from>datatype::String</from>
>         <to>VARCHAR2(255)</to>
>         <condition>columnLength < 255</condition>
>     </mapping>
>     <mapping>
>         <from>datatype::String</from>
>         <to>VARCHAR2(4000)</to>
>         <condition>columnLength <= 4000</condition>
>     </mapping>
>     <mapping>
>         <from>datatype::String</from>
>         <to>CLOB</to>
>         <condition>columnLength >4000</condition>
>     </mapping>
> And for Informix database (btw. there is no Informix support currently in 
> AndorMDA, but the same issue is for PostgreSQL):
>     <mapping>
>         <from>datatype::String</from>
>         <to>VARCHAR2(255)</to>
>         <condition>columnLength < 255</condition>
>     </mapping>
>     <mapping>
>         <from>datatype::String</from>
>         <to>LVARCHAR2(32726)</to>
>         <condition>columnLength <= 32726</condition>
>     </mapping>
>     <mapping>
>         <from>datatype::String</from>
>         <to>CLOB</to>
>         <condition>columnLength > 32726</condition>
>     </mapping>
> IMO is should be done in mapping file and not hardcoded in java. The above is 
> just suggestion, maybe there is simpler way to achieve this feature.




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

Reply via email to