Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.FetchOptions.offset()


    if (this.limit != 0)
      opts = opts.limit(this.limit);

    if (this.offset != 0)
      opts = opts.offset(this.offset);

    if (this.chunk == null)
      opts = opts.chunkSize(DEFAULT_CHUNK_SIZE);
    else
      opts = opts.chunkSize(this.chunk);
View Full Code Here


    FetchOptions options = null;
    if (queryInfo.top != null)
      options = FetchOptions.Builder.withLimit(queryInfo.top);
    if (queryInfo.skip != null)
      options = options == null ? FetchOptions.Builder.withOffset(queryInfo.skip) : options.offset(queryInfo.skip);

    Iterable<Entity> iter = options == null ? pq.asIterable() : pq.asIterable(options);

    final QueryInfo qi = queryInfo;
    List<OEntity> entities = Enumerable.create(iter).select(new Func1<Entity, OEntity>() {
View Full Code Here

        FetchOptions foTest = FetchOptions.Builder.withDefaults();
        int ttl = service.prepare(q).countEntities(foTest.limit(500));
        assertEquals(500, ttl);

        foTest = FetchOptions.Builder.withDefaults();
        ttl = service.prepare(q).countEntities(foTest.offset(150));
        assertEquals((bigCount - 150), ttl);

        fo = FetchOptions.Builder.withDefaults();
        ttl = service.prepare(q).countEntities(foTest.offset(50).limit(150));
        assertEquals(150, ttl);
View Full Code Here

        foTest = FetchOptions.Builder.withDefaults();
        ttl = service.prepare(q).countEntities(foTest.offset(150));
        assertEquals((bigCount - 150), ttl);

        fo = FetchOptions.Builder.withDefaults();
        ttl = service.prepare(q).countEntities(foTest.offset(50).limit(150));
        assertEquals(150, ttl);

        fo = FetchOptions.Builder.withDefaults();
        ttl = service.prepare(q).countEntities(foTest.limit(150).offset(offset));
        int expect = (150 < (bigCount - offset)) ? 150 : (bigCount - offset);
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.