[jira] Created: (OJB-133) Query exception occur if a field name is equals to a database function/keyword
"Armin Waibel (JIRA)" <[email protected]> Sat, 17 Mar 2007 18:33:09 -0700 (PDT)
| Newsgroups | gmane.comp.jakarta.ojb.devel |
|---|---|
| Message-ID | <18722211.1174181589253.JavaMail.jira@brutus> |
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.