[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-09-15 Thread lp
i raised it as an issue as i am unable to get resolution.

http://code.google.com/p/googleappengine/issues/detail?id=5897

vote if u has a similar problem.

-lp

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-08-15 Thread datanucleus
 however i have the following issues.

 1.I am using the query  Select c from ChatUser c where c.key =:keyList
 elsewhere and it is working fine. How can it be working?

Because Google didn't respect valid JDOQL when they implemented their
plugin and allowed nonsense like that query (the syntax is GQL). For
portability you should never use it.

The log tells you plenty about the query, and just wish people could
refer to it.

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-08-15 Thread lp

On Aug 15, 6:09 pm, datanucleus andy_jeffer...@yahoo.com wrote:
  however i have the following issues.

  1.I am using the query  Select c from ChatUser c where c.key =:keyList
  elsewhere and it is working fine. How can it be working?

 Because Google didn't respect valid JDOQL when they implemented their
 plugin and allowed nonsense like that query (the syntax is GQL). For
 portability you should never use it.

fair enough.

But when i use a normal key field everything works. any ideas?
   @Basic
   private Key parentKey2;
Query chatUserQuery = em.createQuery(Select c from ChatUser c where
c.parentKey2 IN (:parentKeyList));

 The log tells you plenty about the query, and just wish people could
 refer to it.

i got logging set to DEBUG.
all i see in my logs is the following.
is there something in my logging that i have missed?

18:21:31,184 DEBUG [DataNucleus.Query] - JPQL Single-String with
Select c from ChatUser c where c.parentKey IN (:parentKeyList)
18:21:31,197 DEBUG [DataNucleus.Query] - JPQL Query : Compiling
SELECT c FROM ChatUser c WHERE c.parentKey IN (:parentKeyList)
18:21:31,206 DEBUG [DataNucleus.ClassLoading] - Class
java.lang.ChatUser was not found in the CLASSPATH [Class resolver
called from org.datanucleus.util.Imports.resolveClassDeclaration
(line=177)]
18:21:31,206 DEBUG [DataNucleus.ClassLoading] - Class
java.lang.ChatUser was not found in the CLASSPATH [Class resolver
called from org.datanucleus.util.Imports.resolveClassDeclaration
(line=177)]
18:21:31,215 DEBUG [DataNucleus.Query] - JPQL Query : Compile Time =
18 ms
18:21:31,217 DEBUG [DataNucleus.Query] - DATASTORE Query : Executing
SELECT c FROM ChatUser c WHERE c.parentKey IN (:parentKeyList) ...

thanks

-lp

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-08-14 Thread lp

On Aug 12, 7:03 pm, datanucleus andy_jeffer...@yahoo.com wrote:
 Invalid JPQL (a Key cannot equal a List). This makes more sense
 Select c from ChatUser c where c.parentKey IN :parentKey

thanks for the response.

however i have the following issues.

1.I am using the query  Select c from ChatUser c where c.key =:keyList
elsewhere and it is working fine. How can it be working?

2. When i run the IN i get the following error.
org.datanucleus.store.appengine.query.DatastoreQuery
$UnsupportedDatastoreFeatureException: Problem with query SELECT c
FROM ChatUser c WHERE c.parentKey IN :parentKeyList: Unexpected
expression type while parsing query:
org.datanucleus.query.expression.SubqueryExpression

have got these queries completely wrong?

-lp

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-08-14 Thread lp
 1.I am using the query  Select c from ChatUser c where c.key =:keyList
 elsewhere and it is working fine. How can it be working?

i now concerned how the above query can work.
i assumed it was producing an IN/OR query, hence limited by 30 OR
statements.
however unit testing in the development environment shows that i can
run over 130 elements in the List parameter without any fault
generation.
ie
  ListKey parentList = new ArrayListKey();
   parentList.add(user1.getKey());
   parentList.add(user2.getKey());
   for( int i=0; i130; i++){
   parentList.add(KeyFactory.createKey(ChatUser.CLASS_NAME, i
+11) );
   }

what i thought i understood is now very confusing.

-lp

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-08-14 Thread lp
On Aug 12, 7:03 pm, datanucleus andy_jeffer...@yahoo.com wrote:
 Invalid JPQL (a Key cannot equal a List). This makes more sense
 Select c from ChatUser c where c.parentKey IN :parentKey

i tried the IN clause it get the same error.

   @Basic
   @Extension(vendorName=datanucleus, key=gae.parent-pk, value =
true)
   private Key parentKey;

Query chatUserQuery = em.createQuery(Select c from ChatUser c where
c.parentKey IN (:parentKeyList));

produces error
java.lang.ClassCastException: java.util.ArrayList cannot be cast to
com.google.appengine.api.datastore.Key
at
org.datanucleus.store.appengine.query.DatastoreQuery.internalPkToKey(DatastoreQuery.java:
1484)


But when i use a normal key field everything works.
   @Basic
   private Key parentKey2;

Query chatUserQuery = em.createQuery(Select c from ChatUser c where
c.parentKey2 IN (:parentKeyList));

the issue seems to be with the gae.parent-pk not the query.

-lp

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: gae.parent-pk doesnt work in list query

2011-08-12 Thread datanucleus
Invalid JPQL (a Key cannot equal a List). This makes more sense
Select c from ChatUser c where c.parentKey IN :parentKey

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.