Issue Details (XML | Word | Printable)

Key: NUCRDBMS-324
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: André
Votes: 1
Watchers: 2
Operations

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

JDOQL : navigational query through two levels of collection using declareVariables causes invalid SQL

Created: 28/Aug/06 09:49 PM   Updated: 17/Mar/10 08:52 PM   Resolved: 04/Mar/10 06:04 PM
Component/s: Queries
Affects Version/s: None
Fix Version/s: 2.0.2

File Attachments: 1. Zip Archive jpox.zip (2 kB)

Environment: jpox 1.1.1 - Windows platform - mysql5 - Java5

Forum Thread URL: http://www.jpox.org/servlet/forum/viewthread?thread=3701
Datastore: MySQL
Severity: Development


 Description  « Hide
problem reported in forum :
http://www.jpox.org/servlet/forum/viewthread?thread=3701

Summary :

Query aQuery = pm.newQuery(virtualdoc.class, "fieldsList.contains(aField) && aField.name =='fieldName' && aField.values.contains(aValue) && aValue.length()>0")
aQuery.declareImports("import virtual.*");
aQuery.declareVariables("virtual.virtualField aField; java.lang.String aValue");
aQuery.execute();

Error : java.sql.SQLException: Unknown column 'UNBOUND_AFIELD_VALUES_AVALUE.STRING_ELE' in 'where clause'


bug report requested by Erik.

Thanks.

Sort Order: Ascending order - Click to sort in descending order
Clinton Lee added a comment - 30/Jul/07 08:19 AM
I am expierencing the same issue using JPOX 1.1.8 and believe this is related to (or dare I say the same as?) bug CORE-2700

Andy Jefferson added a comment - 23/Mar/09 12:30 PM
Query issues like this will not be addressed with the legacy JDOQL implementation; wait for "JDOQL2" to be complete

Andy Jefferson added a comment - 04/Mar/10 05:54 PM
Likely fixed in DataNucleus 2.0.2 using JDOQL2 implementation

Andy Jefferson added a comment - 04/Mar/10 06:04 PM
Works fine with JDOQL2 implementation in SVN trunk.

SQL generated is
SELECT 'org.datanucleus.test.virtualDoc' AS NUCLEUS_TYPE,A0.OBJID
FROM VIRTUALDOC A0
INNER JOIN VIRTUALDOC_FIELDS B0 ON A0.OBJID = B0.OBJID_OID
INNER JOIN VIRTUALFIELD C0 ON B0.OBJID_EID = C0.OBJID
INNER JOIN VIRTUALFIELD_VALUES D0 ON C0.OBJID = D0.OBJID_OID
WHERE C0."NAME" = 'testfield'
AND CHAR_LENGTH(D0."ELEMENT") > 0