History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CASTOR-928
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Werner Guttmann
Reporter: Martin Fuchs
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

OQL: allow to use constants in comparison expressions with bind values

Created: 13/Nov/04 05:25 AM   Updated: 19/Apr/05 10:53 AM
Component/s: JDO
Affects Version/s:
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File castor-1791.patch (2 kb)
2. Text File castor-1791.patch (2 kb)
3. Text File x.patch (1 kb)

Operating System: All
Platform: All

Bugzilla Id: 1791

 Description  « Hide
This patch allows to use constants in comparison expressions with bind values.
Here are some simple examples:

"... where $1 = \"ABC\""
"... where $(int)1 < 4711"

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Martin Fuchs - 13/Nov/04 05:26 AM
Created an attachment (id=770)
proposed patch

Werner Guttmann - 19/Nov/04 12:30 PM
How does Castor currently deal with below examples ?

Martin Fuchs - 19/Nov/04 03:24 PM
Well, it throws exceptions like the following:

org.exolab.castor.jdo.QueryException: Could not get type for comparison.
at org.exolab.castor.jdo.oql.ParseTreeWalker.getTypeForComparison
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkParameter
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkErrors
at org.exolab.castor.jdo.oql.ParseTreeWalker.<init>
at org.exolab.castor.jdo.engine.OQLQueryImpl.create
at org.exolab.castor.jdo.engine.DatabaseImpl.getOQLQuery
at scottTest.DeptEmp.run(DeptEmp.java:89)
at scottTest.DeptEmp.main(DeptEmp.java:19)

Werner Guttmann - 22/Nov/04 01:38 AM
Thanks. Can you please attach a JUnit test case, that shows the current
problem(s) and will run successfully once the patch has been applied. Whether or
not this test case finally makes it into the test suite we'll talk about at a
later point of time.

Werner Guttmann - 26/Nov/04 03:53 AM
Martin ? If you'd like to get this into the RC2, this'd be the perfect time to
expand your patch, wouldn't it? Sorry for being cheeky here ... ,-).

Martin Fuchs - 28/Nov/04 03:15 PM
Created an attachment (id=793)
test case

This test case is integrated in the already existing OQL tests in OqlTests.java
and shows how to successfully compare an bind variable parameter with a

Martin Fuchs - 28/Nov/04 03:17 PM
Created an attachment (id=794)
updated patch

update to the current CVS code

Werner Guttmann - 29/Nov/04 03:48 AM
Patch applied.

Werner Guttmann - 29/Nov/04 03:48 AM
Patch applied (once more .. ).