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
Operations

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

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: 0.9.5.4
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)

Environment:
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
(ParseTreeWalker.java:763)
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkParameter
(ParseTreeWalker.java:733)
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
(ParseTreeWalker.java:593)
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
(ParseTreeWalker.java:601)
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
(ParseTreeWalker.java:601)
at org.exolab.castor.jdo.oql.ParseTreeWalker.checkErrors
(ParseTreeWalker.java:240)
at org.exolab.castor.jdo.oql.ParseTreeWalker.<init>
(ParseTreeWalker.java:140)
at org.exolab.castor.jdo.engine.OQLQueryImpl.create
(OQLQueryImpl.java:254)
at org.exolab.castor.jdo.engine.DatabaseImpl.getOQLQuery
(DatabaseImpl.java:462)
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
constant.


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