Issue Details (XML | Word | Printable)

Key: JDO-274
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

JPOX doesnt support queries selecting just a parameter

Created: 09/Jan/06 05:42 PM   Updated: 22/Jan/06 08:28 PM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 22/Jan/06 08:28 PM


 Description  « Hide
When a JDOQL query selects just a parameter, JPOX has a SELECT statement with no columns selected resulting in a JDOUserException being thrown. This is demonstrated on TCK test
org.apache.jdo.tck.query.result.ResultExpressions.testParameter

[It has to be questioned why someone would want to create a JDOQL query of this form, since they supply the value of the parameter in the first place ;-)]

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Erik Bengtson added a comment - 22/Jan/06 01:02 AM
1. The test should be extended to set values of different types. The basics Null, String and Long values, a non persistent object as parameter, which would make difficult to execute the query, and last, the test should also set a detached instance as parameter.

2. I agree with the expected result, but someone could ask why.

In SQL: SELECT literal value from TABLE WHERE condition, if condition evaluates to true, the literal is only one time in the result.

In JDOQL, that is not the case, so if condition evaluates to true, it will return N times the literal for N instances that evaluated to true. Of course, if DISTINCT keyword it turns to return 1 instance.


Erik Bengtson added a comment - 22/Jan/06 08:28 PM
fixed in JPOX

Erik Bengtson made changes - 22/Jan/06 08:28 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]