db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CG Monroe (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TORQUE-177) SQLFunction interface should extend Column
Date Mon, 12 Dec 2011 20:53:30 GMT
SQLFunction interface should extend Column
------------------------------------------

                 Key: TORQUE-177
                 URL: https://issues.apache.org/jira/browse/TORQUE-177
             Project: Torque
          Issue Type: Improvement
          Components: Runtime
    Affects Versions: 4.0
            Reporter: CG Monroe


Support for DBA specific SQL Functions / Expression was added right after 3.3 was released.
 See org.apache.torque.utils.SummaryHelper and org.apache.torque.utils.functions package.
 This allows for SQL functions to be specified in queries in an SQL version independent way.
 E.g. string concatenation can be different on different servers.

Since SQLFunctions are created with all the same info that a Column object needs, it does
not make sense to have to do:  

<pre>
hoursMax = FunctionFactory.max(TimeCard.HOURS);
Column col = new ColumnImpl(
  null,
  TimeCard.HOURS.getTableName(),
  TimeCard.HOURS.getColumnName(),
  maxHours.toSQL()
);
criteria.addAsColumn(col);
</pre>

Since SQLFunctions contain the needed info for columns, the SQLFunction interface extend Column
and supply the required column info via the Column functions. This means that SQLFunctions
could be just added via:

criterial.addAsColumn(FunctionFactory.max(TimeCard.HOURS);



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