Issue Details (XML | Word | Printable)

Key: NUCRDBMS-359
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Marco Schulze
Votes: 0
Watchers: 0
Operations

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

JDOQL2 : Support select of expressions with more than 1 component

Created: 05/Apr/10 04:47 PM   Updated: 13/Apr/10 07:27 PM   Resolved: 06/Apr/10 08:44 AM
Component/s: Queries
Affects Version/s: 2.1.0.m1
Fix Version/s: 2.1.0.m2

Forum Thread URL: http://www.jpox.org/servlet/forum/viewthread_thread,6046


 Description  « Hide
When executing the pretty simple query

@javax.jdo.annotations.Query(
  name="getAllUseCaseIDs",
  value="SELECT JDOHelper.getObjectId(this)"
)

the following exception happens:

Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid
org.datanucleus.exceptions.NucleusException: Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid
        at org.datanucleus.store.rdbms.sql.SQLStatement.select(SQLStatement.java:418)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileResult(QueryToSQLMapper.java:495)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:319)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:775)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:256)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1634)
        at org.datanucleus.store.query.Query.executeWithArray(Query.java:1505)
        at org.datanucleus.store.query.Query.execute(Query.java:1478)
        at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
        at org.datanucleus.test.PropertySetFieldBasedEditLayoutUseCase.getAllUseCaseIDs(PropertySetFieldBasedEd
itLayoutUseCase.java:116)
        at org.datanucleus.test.Main$QueryDataTransRunnable.run(Main.java:92)
        at org.datanucleus.test.Main.executeInTransaction(Main.java:65)
        at org.datanucleus.test.Main.main(Main.java:174)

Test case: http://www.nightlabs.de/~marco/datanucleus/2010-04-05.00/

Marco Schulze made changes - 05/Apr/10 04:50 PM
Field Original Value New Value
Description Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid
org.datanucleus.exceptions.NucleusException: Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid
        at org.datanucleus.store.rdbms.sql.SQLStatement.select(SQLStatement.java:418)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileResult(QueryToSQLMapper.java:495)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:319)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:775)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:256)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1634)
        at org.datanucleus.store.query.Query.executeWithArray(Query.java:1505)
        at org.datanucleus.store.query.Query.execute(Query.java:1478)
        at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
        at org.datanucleus.test.PropertySetFieldBasedEditLayoutUseCase.getAllUseCaseIDs(PropertySetFieldBasedEd
itLayoutUseCase.java:116)
        at org.datanucleus.test.Main$QueryDataTransRunnable.run(Main.java:92)
        at org.datanucleus.test.Main.executeInTransaction(Main.java:65)
        at org.datanucleus.test.Main.main(Main.java:174)

Test case: http://www.nightlabs.de/~marco/datanucleus/2010-04-05.00/
When executing the pretty simple query

@javax.jdo.annotations.Query(
  name="getAllUseCaseIDs",
  value="SELECT JDOHelper.getObjectId(this)"
)

the following exception happens:

Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid
org.datanucleus.exceptions.NucleusException: Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid
        at org.datanucleus.store.rdbms.sql.SQLStatement.select(SQLStatement.java:418)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileResult(QueryToSQLMapper.java:495)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:319)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:775)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:256)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1634)
        at org.datanucleus.store.query.Query.executeWithArray(Query.java:1505)
        at org.datanucleus.store.query.Query.execute(Query.java:1478)
        at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
        at org.datanucleus.test.PropertySetFieldBasedEditLayoutUseCase.getAllUseCaseIDs(PropertySetFieldBasedEd
itLayoutUseCase.java:116)
        at org.datanucleus.test.Main$QueryDataTransRunnable.run(Main.java:92)
        at org.datanucleus.test.Main.executeInTransaction(Main.java:65)
        at org.datanucleus.test.Main.main(Main.java:174)

Test case: http://www.nightlabs.de/~marco/datanucleus/2010-04-05.00/
Andy Jefferson made changes - 06/Apr/10 08:41 AM
Summary Cannot select SQLExpression with more than 1 component : a0.organisationid,a0.usecaseid JDOQL2 : Support select of expressions with more than 1 component
Issue Type Bug [ 1 ] New Feature [ 2 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 2.1.0.m2 [ 10912 ]
Component/s Queries [ 10142 ]
Andy Jefferson added a comment - 06/Apr/10 08:44 AM
SVN trunk handles this, and unit test is now present in test.jdo.application.

PS, for the n'th time, Nightlabs testcase style is excessively large. Why have 20 lines to create a PMF when you can just do
pmf = JDOHelper.getPersistenceManagerFactory("datanucleus.properties");
In terms of namings "persistenceManagerFactory"->"pmf", "persistenceManager"->"pm"

Andy Jefferson made changes - 06/Apr/10 08:44 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Marco Schulze made changes - 13/Apr/10 07:27 PM
Status Resolved [ 5 ] Closed [ 6 ]