db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armin Waibel (JIRA)" <j...@apache.org>
Subject [jira] Created: (OJB-133) Query exception occur if a field name is equals to a database function/keyword
Date Sun, 18 Mar 2007 01:33:09 GMT
Query exception occur if a field name is equals to a database function/keyword
------------------------------------------------------------------------------

                 Key: OJB-133
                 URL: https://issues.apache.org/jira/browse/OJB-133
             Project: OJB
          Issue Type: Bug
          Components: JDO-API, ODMG-API, PB-API
    Affects Versions: 1.0.4
            Reporter: Armin Waibel


Example:
Criteria crit = new Criteria().addGreaterThan("abs(as)", new Integer(0));
Query q = QueryFactory.newQuery(Key.class, crit);

A field of class Key is named "as" which  will cause problems in addGreaterThan("abs(as)",
new Integer(0)) and OJB will produce:
SELECT ...  AND abs(as) > ?
The field "as" will not be replaced by the column name (A0.AS_), because OJB thinks it's a
function or keyword. Same problems occur e.g. with count,min,max,avg,sum,upper,lower,distinct,as
(and all other supported functions)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message