After debugging more, I found out that I was passing secPermKeyList as
null. Hence I was getting zero results back.
But, after correcting that issue and passing a valid Key list, I get the
following error
Testcase: testSecurityGroup took 1.351 sec
Caused an ERROR
Illegal argument
javax.jdo.JDOFatalUserException: Illegal argument
at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:344)
at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252)
at
com.veersoft.util.QueryUtil.getSecurityPermissionList(QueryUtil.java:15)
at
com.veersoft.security.SecurityGroupTest.testSecurityGroup(SecurityGroupTest.java:46)
at
org.datanucleus.store.appengine.JDOTestCase.runTest(JDOTestCase.java:61)
NestedThrowablesStackTrace:
java.lang.IllegalArgumentException: can't operate on multiple entity groups
in a single transaction. found both Element {
type: "SecurityPermission"
id: 2
}
and Element {
type: "SecurityPermission"
id: 1
}
Finally, I have to switch the datasource to 'nontransactional' before
executing the query to make my test pass.
-Aswath
On Wed, Jan 20, 2010 at 8:54 PM, aswath satrasala <
[email protected]> wrote:
> Hello
> I have the following class
> public class SecurityPermission {
> @PrimaryKey
> @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> private Key key;
>
> @Persistent
> private String name;
> }
>
> I have the following query on SecurityPermission Entity to filter by keys.
> Query q = pm.newQuery("select key from " +
> SecurityPermission.class.getName() + " where :p1.contains(key)");
> return (List<SecurityPermission>) q.execute(secPermKeyList);
>
> I always get zero results if I supply the key's filter. I remove the key's
> filter, then I get all the entities.
>
> How should the query be which involves a list of keys?
>
> -Aswath
>
--
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.