problem about emf+jpox query [message #609903] |
Mon, 08 October 2007 02:00 |
Eclipse User |
|
|
|
Originally posted by: danceslower.sina.com
Hi All
There is a strange problem in object query during using emf+jpox.
There is a 1-n relation between Class Car and Class Part, which means one
Car contains n Parts. When I use this query:
////////////////////
query = pm.newQuery("javax.jdo.query.JDOQL", "SELECT FROM Part WHERE car ==
threshold");
query.declareImports("import Car");
query.declareParameters("Car threshold");
List results = (List)query.execute("BMW");
/////////////////////////////
Exception are throwed:
Exception in thread "main" java.lang.NullPointerException
at org.jpox.store.expression.UnboundVariable.eq(UnboundVariable .java:184)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileEquali tyExpression(JDOQLQuery.java:1609)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileAndExp ression(JDOQLQuery.java:1591)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileExclus iveOrExpression(JDOQLQuery.java:1579)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileInclus iveOrExpression(JDOQLQuery.java:1567)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileCondit ionalAndExpression(JDOQLQuery.java:1555)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileCondit ionalOrExpression(JDOQLQuery.java:1537)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileExpres sion(JDOQLQuery.java:1514)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileExpres sionFromString(JDOQLQuery.java:1475)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.compileFilter (JDOQLQuery.java:1314)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.performCompil e(JDOQLQuery.java:924)
at
org.jpox.store.rdbms.query.JDOQLQuery$Compiler.executionComp ile(JDOQLQuery.java:897)
at
org.jpox.store.rdbms.query.JDOQLQuery.performExecute(JDOQLQu ery.java:497)
at org.jpox.store.query.Query.executeWithMap(Query.java:959)
at org.jpox.store.query.Query.executeWithArray(Query.java:932)
at org.jpox.store.query.Query.execute(Query.java:855)
at test.TestQuery.queryPartData(TestQuery.java:34)
at test.TestQuery.main(TestQuery.java:18)
what is the meaning of that?
|
|
|
Powered by
FUDForum. Page generated in 0.03634 seconds