glaforge/gaelyk — Issue #94: Coerced queries that return a list should coerce on the fly similar to iterator
Author: codeconsole
Created: 2011-11-20 05:06:12+00:00
State: open

The current implementation is as follows
def entities = preparedQuery.asList(options)
// use "manual" collect{} as in the context of the query{} call
// the delegation transforms the class into a string expression
def result = []
for (entity in entities) result << entity.asType(coercedClass)

return result
but if you notice, App Engine does not return a normal list. asList actually should behave asynchronously. The current implementation negates that behavior by flushing at the time of coercion.

This implementation should wrap the returned list similar to how the iterator implementation works and coerce on the fly.