What do you mean by every query result greater than 1? Do you mean
that you get "null" if you get a list of comments with a size greater
than 1?

On Mon, Mar 8, 2010 at 12:21 PM, atomi <[email protected]> wrote:
> I'm trying to get cursors working with a result set but the
> JDOCursorHelper.getCursor() method returns null for every query result that
> is greater than 1
> here is my entity method
> Item entity:
>        �...@element(dependent = "true")
> @Persistent(defaultFetchGroup="true",loadFetchGroup="true")
> List<String> comments = new ArrayList<String>();
> def getComments() {
> List comments
> List results
> if (this.comments.isEmpty()) {
> return this.comments
> }
> PersistenceManager pm = PMF.get().getPersistenceManager()
> try {
> javax.jdo.Query q = pm.newQuery("select from " +
> Comment.class.getName() +
> " where :keys.contains(key)")
> q.setOrdering("datetime desc");
> q.setRange(0, 5);
> results = q.execute(this.comments);
> Cursor cursor = JDOCursorHelper.getCursor(results);
> if(cursor != null){
> this.cursorString = cursor.toWebSafeString();
> }
> comments = pm.detachCopyAll((List) results)
> comments.size();
> return comments
> } finally {
> pm.close()
> }
> }
> Can someone tell me why?
>
> --
> 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.
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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.

Reply via email to