google-code-export / slim3

Automatically exported from code.google.com/p/slim3
1 stars 1 forks source link

Please add asKeyIterator for queries #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Appengine 1.4.0 brings async queries support behind the scenes.
This support only works with Iterators result sets.

/**
     * Returns key iterator.
     * 
     * @return Iterator of keys.
     */
    public Iterator<Key> asKeyIterator() {
        query.setKeysOnly();
        final Iterator<Entity> entityIterator = asEntityIterator();
        return new Iterator<Key>() {
            public void remove() {
                entityIterator.remove();
            }

            public Key next() {
                return entityIterator.next().getKey();
            }

            public boolean hasNext() {
                return entityIterator.hasNext();
            }
        };
    }

Original issue reported on code.google.com by gal.dol...@gmail.com on 15 Dec 2010 at 11:15

GoogleCodeExporter commented 9 years ago

Original comment by higaya...@gmail.com on 15 Dec 2010 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by gal.dol...@gmail.com on 21 Dec 2010 at 5:11

GoogleCodeExporter commented 9 years ago

Original comment by higaya...@gmail.com on 23 Dec 2010 at 1:48

GoogleCodeExporter commented 9 years ago

Original comment by higaya...@gmail.com on 23 Dec 2010 at 5:47