Package com.google.appengine.api.datastore

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


        // index of the last result minus the offset.  For example, if
        // fromInclNo is 10 and toExclNo is 25, the limit for the query
        // is 15 because we want 15 results starting after the first 10.

        // We know that offset won't be null because opts is not null.
        opts.limit(intExclNo - offset);
      }
    }
    Cursor cursor = getCursor();
    // If we have a cursor, add it to the fetch options
    if (cursor != null) {
View Full Code Here


        // index of the last result minus the offset.  For example, if
        // fromInclNo is 10 and toExclNo is 25, the limit for the query
        // is 15 because we want 15 results starting after the first 10.

        // We know that offset won't be null because opts is not null.
        opts.limit(intExclNo - offset);
      }
    }
    Cursor cursor = getCursor();
    // If we have a cursor, add it to the fetch options
    if (cursor != null) {
View Full Code Here

    if (this.endAt != null)
      opts = opts.endCursor(this.endAt);

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

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

    if (this.chunk == null)
View Full Code Here

        Query q = new Query(kindName, rootKey).addSort("count", Query.SortDirection.DESCENDING);
        Entity e = service.prepare(q).asIterator().next();
        assertEquals(new Integer(bigCount - 1).longValue(), e.getProperty("count"));

        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);
View Full Code Here

        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);
        assertEquals(expect, ttl);
    }

    @Test
View Full Code Here

    protected FetchOptions getFetchOptions( int offset, int count ) {
        FetchOptions fo = withOffset( offset );

        if (isLimit( count )) {
            fo = fo.limit( count );
        }

        return fo;
    }
View Full Code Here

        // index of the last result minus the offset.  For example, if
        // fromInclNo is 10 and toExclNo is 25, the limit for the query
        // is 15 because we want 15 results starting after the first 10.

        // We know that offset won't be null because opts is not null.
        opts.limit(intExclNo - offset);
      }
    }
    Cursor cursor = getCursor();
    // If we have a cursor, add it to the fetch options
    if (cursor != 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.