db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject SQL name lengths
Date Sat, 03 Sep 2011 19:34:55 GMT

Currently (and in Torque 3), there is the method
org.apache.torque.templates.platform.Platform.getMaxColumnNameLength(). The
idea is that different database servers have different maximum SQL name
(e.g. column, table names) lenghts and so SQL names should be chopped
differently for different databases.
This method is currently not used for generation (and was not used in the
past afaik). The problem with it is that it makes generated code
database-dependent and this was what we wanted to avoid for Torque 4.
I see three possible solutions
(1) do not chop sql names at all, accept that too long names cause problems
in some databases and remove the getMaxColumnNameLength() method
(2) chop sql names at the minimum length of all databases (this would
probably be oracle with 30 characters table and column name lengths)
(3) accept that the generated code is database-dependent and rename the
method getMaxColumnNameLength() to getMaxSqlNameLength()

Personally I find (3) is by far the worst solution, I'd really like to get
rid of database dependent generated code. (2) is ok with me personally  as
I use oracle most of the time anyway, but I have a slight tendency towards
(1) because it is the simplest solution. What do you think ?

    Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message