I think I have found a bug in the datanucleus JDO named query code
(which I am happy to file a jira
report on if others agree)...
imagine the following:
@Queries { value = { @Query(name="foo" value="select from
FOO...") } )
public class Foo {
//...
}
at some point later in the code is uttered:
Query q = pm.newNamedQuery(Foo.class, "Foo");
now this should cause the query named "Foo" in the annotations above
to be "found" and prepared for later
execution...
such that:
q.execute(...)
would execute the named query ...
except it doesn't ... it throws:
org.datanucleus.query.expression.PrimaryExpressionIsVariableException ...
this is because the code in
org.datanucleus.jdo.JDOPersistenceManagerProxy reads:
public Query newNamedQuery(Class cls, String filter) {
return getPM().newQuery(cls, filter);
}
and should in fact read:
return getPM().newNamedQuery(cls, name);
The error results in the name of the query being set as a filter on an
empty query, which is subsequently auto
populates, and sets the name of the query as a filter ... hence the
exception.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---