Package com.google.appengine.api.datastore

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


          entityIterable = entities;
        } else {
          entityIterable = preparedQuery.asQueryResultIterable(opts);
        }
      } else {
        entityIterable = preparedQuery.asQueryResultIterable();
      }

      return wrapEntityQueryResult(entityIterable, qd.resultTransformer, ds, endCursor);
    }
  }
View Full Code Here


     *
     * @return entities as query result iterable
     */
    public QueryResultIterable<Entity> asQueryResultEntityIterable() {
        PreparedQuery pq = prepareQuery();
        return pq.asQueryResultIterable(fetchOptions);
    }

    /**
     * Returns a single entity.
     *
 
View Full Code Here

     *
     * @return entities as query result iterable
     */
    public QueryResultIterable<Entity> asQueryResultEntityIterable() {
        PreparedQuery pq = txSet ? ds.prepare(tx, query) : ds.prepare(query);
        return pq.asQueryResultIterable(fetchOptions);
    }

    /**
     * Returns a single entity.
     *
 
View Full Code Here

            public <ReceiverThrowableType extends Throwable> void transferTo( Output<? super Reader, ReceiverThrowableType> output )
                throws IOException, ReceiverThrowableType
            {
                Query query = new Query();
                PreparedQuery preparedQuery = datastore.prepare( query );
                final QueryResultIterable<Entity> iterable = preparedQuery.asQueryResultIterable();

                output.receiveFrom( new Sender<Reader, IOException>()
                {
                    @Override
                    public <ReceiverThrowableType extends Throwable> void sendTo( Receiver<? super Reader, ReceiverThrowableType> receiver )
View Full Code Here

  @Test
  public void testCursorEndLowLevelBehavior() throws Exception {
    com.google.appengine.api.datastore.Query query = new com.google.appengine.api.datastore.Query("Trivial");
    PreparedQuery pq = ds().prepare(query);

    QueryResultIterator<Entity> it = pq.asQueryResultIterable().iterator();
    it.next();
    it.next();
    assert !it.hasNext();

    Cursor cursor = it.getCursor();
View Full Code Here

    assert !it.hasNext();

    Cursor cursor = it.getCursor();
    assert cursor != null;

    QueryResultIterator<Entity> it2 = pq.asQueryResultIterable(FetchOptions.Builder.withStartCursor(cursor)).iterator();
    assert !it2.hasNext();

    Cursor cursor2 = it2.getCursor();
    assert cursor2 != null;
View Full Code Here

    assert !it2.hasNext();

    Cursor cursor2 = it2.getCursor();
    assert cursor2 != null;

    QueryResultIterator<Entity> it3 = pq.asQueryResultIterable(FetchOptions.Builder.withStartCursor(cursor2)).iterator();
    assert !it3.hasNext();
    assert it3.getCursor() != null;
  }

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