db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (Issue Comment Edited) (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (TORQUE-168) Use Objects instead of Strings for Column constants in Peers and Criteria
Date Thu, 06 Oct 2011 00:02:29 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117279#comment-13117279
] 

Thomas Fox edited comment on TORQUE-168 at 10/6/11 12:01 AM:
-------------------------------------------------------------

Implementation plan:
- create an interface Column with the methods getColumnName(), getTableName() and getSqlExpression()
- replace all occurances where String column names are used by the column interface. This
will e.g. be the add, and, or ... methods in Criteria, the key in the ColumnValues object.
- make ColumnMap implement the Column interface. This is straightforward, the default schema
name can be retrieved from database.getSchema()
- create a simple implementation of the Column interface with the needed getters and corresponding
setters. This can be used if users want to create their own Column instance.

The question remains open how to access the correct ColumnMap instances from the peer classes
to fill the column constants.
                
      was (Author: tfischer):
    Implementation plan:
- create an interface Column with the methods getColumnName(), getTebleName(), getSchemaName()
and getSqlExpression()
- replace all occurances where String column names are used by the column interface. This
will e.g. be the add, and, or ... methods in Criteria, the key in the ColumnValues object.
- make ColumnMap implement the Column interface. This is straightforward, the default schema
name can be retrieved from database.getSchema()
- create a simple implementation of the Column interface with the needed getters and corresponding
setters. This can be used if users want to create their own Column instance.

The question remains open how to access the correct ColumnMap instances from the peer classes
to fill the column constants.
                  
> Use Objects instead of Strings for Column constants in Peers and Criteria
> -------------------------------------------------------------------------
>
>                 Key: TORQUE-168
>                 URL: https://issues.apache.org/jira/browse/TORQUE-168
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>             Fix For: 4.0
>
>
> Currently, column constants in Peers are Strings, and Criterias are constructed by using
String column names.
> This means that code to parse column information (remove/add database/schema name, table
name, remove SQL functions etc) is distributed across the code which is not very maintainable.
> Instead, column constants should be objects, which hold at least the following information
> - unqualified column name
> - table name (or reference to table)
> - database/schema name, if any, or reference to default database/schema name, if any
> - sql expression (in case it is different from [database/schema.]tableName.columnName,
e.g. "cast id as varchar2(30)" in oracle)
> There should be a constructor taking a string input, which then tries to parse the given
tsring and extract the above information from the string.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
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