Examples of asQueryResultList()


Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

              // while(it.hasNext()) { // do it }
             
              // so we can't use the asQueryResultIterable as the cursor is not moved to the end of the current page
              // but moved at each call of iterable.iterator().next()
              // thus we use the List in this case to be able to move directly to the next page with cursors
              QueryResultList<Entity> entities = pq.asQueryResultList(fetchOptions);

              // activates the GaeCtx now that it is initialised
              gaeCtx.activate();
              // sets the current cursor (in stateful mode, cursor is always kept for further use)
              //if(gaeCtx.useCursor){
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

                // then uses offset (in case of IN or != operators)
                //if(offset.isActive()){
                //  fetchOptions.offset(gaeCtx.realOffset);
                //}
                fetchOptions.offset(gaeCtx.realOffset);
                entities = pq.asQueryResultList(fetchOptions);
              }else {
                String cursor = gaeCtx.currentCursor();
                if(cursor!=null){
                  entities = pq.asQueryResultList(
                    fetchOptions.startCursor(Cursor.fromWebSafeString(cursor)));
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

                fetchOptions.offset(gaeCtx.realOffset);
                entities = pq.asQueryResultList(fetchOptions);
              }else {
                String cursor = gaeCtx.currentCursor();
                if(cursor!=null){
                  entities = pq.asQueryResultList(
                    fetchOptions.startCursor(Cursor.fromWebSafeString(cursor)));
                }else {
                  entities = pq.asQueryResultList(fetchOptions);
                }
               
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

                String cursor = gaeCtx.currentCursor();
                if(cursor!=null){
                  entities = pq.asQueryResultList(
                    fetchOptions.startCursor(Cursor.fromWebSafeString(cursor)));
                }else {
                  entities = pq.asQueryResultList(fetchOptions);
                }
               
                // sets the current cursor (in stateful mode, cursor is always kept for further use)
                //if(gaeCtx.useCursor){
                gaeCtx.addCursor(entities.getCursor().toWebSafeString());
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

      Iterable<Entity> entityIterable;
      Cursor endCursor = null;
      if (opts != null) {
        if (opts.getLimit() != null) {
          QueryResultList<Entity> entities = preparedQuery.asQueryResultList(opts);
          endCursor = entities.getCursor();
          entityIterable = entities;
        } else {
          entityIterable = preparedQuery.asQueryResultIterable(opts);
        }
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

     *
     * @return entities as query result list
     */
    public QueryResultList<Entity> asQueryResultEntityList() {
        PreparedQuery pq = prepareQuery();
        return pq.asQueryResultList(fetchOptions);
    }

    /**
     * Returns entities as query result iterator.
     *
 
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

     *
     * @return entities as query result list
     */
    public QueryResultList<Entity> asQueryResultEntityList() {
        PreparedQuery pq = txSet ? ds.prepare(tx, query) : ds.prepare(query);
        return pq.asQueryResultList(fetchOptions);
    }

    /**
     * Returns entities as query result iterator.
     *
 
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

    Long totalEntities = 100L;
    if(summary != null){totalEntities = (Long)summary.getProperty("count");}
   
    while (duelingList.size() < numItems) {
      int randomIndex = (int)(Math.random() * totalEntities);
      Entity randomItem = pq.asQueryResultList(FetchOptions.Builder.withLimit(numRandomItems).offset(randomIndex)).get(0);
      if (!duelingList.contains(randomItem)) {
        duelingList.add(randomItem);
      }
    }
     
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

   
    List<Entity> randomItemList = new ArrayList<Entity>();
   
    while (randomItemList.size() < numItems) {
      int randomIndex = (int)(Math.random() * totalEntities);
      Entity randomItem = pq.asQueryResultList(FetchOptions.Builder.withLimit(1).offset(randomIndex)).get(0);
      if (!randomItemList.contains(randomItem)) {
        randomItemList.add(randomItem);
      }
    }
     
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.asQueryResultList()

    if (cursor == null) {
      fetchOptions = FetchOptions.Builder.withLimit(range);
    } else {
      fetchOptions = FetchOptions.Builder.withStartCursor(cursor).limit(range);
    }
    QueryResultList<Entity> data = query.asQueryResultList(fetchOptions);

    // Re-package.
    GbEntityList<GbEntity> list = new GbEntityList<GbEntity>();
    for (Entity entity : data) {
      GbEntity gbEntity = new GbEntity();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.