db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject provide a central place for parsing column names in SQLBuilder
Date Fri, 10 Dec 2004 11:53:00 GMT




Hi,

In the org.apache.torque.util.SQLBuilder class (recently taken out of
BasePeer), there is a lot of code which parses column names in lots of
places. I would like to go ahead and see if the existing code can be
simplified by creating an internal class in SQLBuilder which represents a
database (pseudo)column, does the parsing and takes care of things like
aliases. I am not sure whether this works out, as there might be subtle
differences in the parsing of raw column names e.g. between the FROM part
and the ORDER BY part of the query, but I'd like to give it a try.

While doing this, I would also like to check whether static schema support
can be easily built in. My fist step would be to allow tablenames which
contain a dot (like SCHEMANAME.TABLENAME). This would mean to replace the
splitting between tablename and columnname, which at the moment looks at
the first dot in the column name (rawColumnName.indexOf('.')), by splitting
at the last dot (rawColumnName.lastIndexOf('.'))
By the way, is the fully qualified column name
SCHEMANAME.TABLENAME.COLUMNNAME in all Db's or are there exceptions ?

Does these changes interfere with any work which is done so far but not yet
committed, or can anyone think of special cases where looking for the last
dot in the raw tablename does not work ?

   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