Execute the typed query and return an iterator of entities

@return Iterator&lt;ENTITY&gt;
190403
@Override
    public Iterator<ENTITY> iterator() {

        StatementWrapper statementWrapper = new BoundStatementWrapper(getOperationType(boundStatement), meta,
                boundStatement, encodedBoundValues);

        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace(String.format("Generate iterator for typed query : %s",
                    statementWrapper.getBoundStatement().preparedStatement().getQueryString()));
        }

        CompletableFuture<ResultSet> futureRS = rte.execute(statementWrapper);
        return new EntityIteratorWrapper<>(futureRS, meta, statementWrapper, options);
    }
673300
public List<Entity> runQuery(String kind) {
    // TODO change so that it's not necessary to hold the entities in a list for integration testing
    // [START runQuery]
    StructuredQuery<Entity> query = Query.newEntityQueryBuilder().setKind(kind).build();
    QueryResults<Entity> results = datastore.run(query);
    List<Entity> entities = Lists.newArrayList();
    while (results.hasNext()) {
      Entity result = results.next();
      // do something with result
      entities.add(result);
    }
    // [END runQuery]
    return entities;
  }
339187
public function getIterator()
    {
        $db = $this->manager->connection();
        // Make sure we have the proper columns before doing anything with SQL
        if (!$this->lockColumnsExist($db)) {
            return;
        }

        $qb = $db->createQueryBuilder();
        $nextQuery = $this->getNextQuery($qb);
        $try = 10;

        while ($next = $this->next($nextQuery)) {
            unset($next[$this->lockColumn]);
            unset($next[$this->lockTimeoutColumn]);
            if (!$this->reserveNext($next, $db)) {
                if ($try--) {
                    // Avoid infinite loop
                    break;
                }

                // We were unable to reserve this properly, lets try the next item instead.
                continue;
            }

            yield $next;
        }
    }
402155
private <T> Iterator<T> getAll(String entityType, IUnmarshaller<T> unmarshaller) throws StorageException {
        String query = matchAllQuery();
        return getAll(entityType, unmarshaller, query);
    }
36333
public Iterator<T> iterator() {
        Collection<ServiceReference<T>> fetchReferences = fetchReferences();
        return new ServiceReferenceIterator<T>(fetchReferences.iterator(), bundleContext);
    }
499622
protected List<Map<String, ResultColumn>> processResultIterator(ResultIterator it) throws DatabaseEngineException {
        List<Map<String, ResultColumn>> res = new ArrayList<>();

        Map<String, ResultColumn> temp;
        while ((temp = it.next()) != null) {
            res.add(temp);
        }

        return res;
    }
931349
final public function findAll()
    {
        $this->query->setStartSelect();

        $this->query->prepare()->bindWhere()->bindLimit()->execute();

        $this->setRowCount();

        $collection = new Collection($this, $this->query->getSqlQuery());

        $this->query->close();

        return $collection();
    }
610820
public function execute() {
        $statement = $this->buildStatement();
        $result = $this->getDataSource()->query($statement, $this->getBindValues());

        if ($result) {
            $collection = new Collection($this->getMapper()->getClass(), $result, $this->getMapper());
        } else {
            $collection = new Collection($this->getMapper()->getClass(), array(), $this->getMapper());
        }
        return $collection;
    }
1288372
function getIterator()
    {
        // TODO improve iteration by pagination

        $realm = $this->getRealm();


        try {
            $sql = "SELECT * FROM `KVStore` WHERE `realm` = '$realm';";

            $stm = $this->pdo->prepare($sql);
            $stm->execute();
            $stm->setFetchMode(\PDO::FETCH_ASSOC);

            $c = $stm->fetchAll();

            foreach ($c as $d)
                yield $d['key'] => $this->getDataInterchange()->retrieveBackward( $d['value'] );

        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }
    }
5206
protected function getEntityIds() {
    $query = $this->getStorage()->getQuery()
      ->sort($this->entityType->getKey('id'), 'DESC');

    $this->limit = 1000;
    if ($this->limit) {
      $query->pager($this->limit);
    }

    return $query->execute();
  }
244568
public DomainQueryResult execute() {
		DomainQueryResult ret = new DomainQueryResult(this);
		Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
		if (so != null) {
			synchronized (so) {
				this.queryExecutor.execute();
			}
		} else
			this.queryExecutor.execute();
		return ret;
	}
850094
public static <E> Iterator<E> get() {
		@SuppressWarnings("unchecked")
		Iterator<E> iter = (Iterator<E>) INSTANCE;
		return iter;
	}
100548
public function runQuery()
    {
        $filters = $this->filters->get();
        $this->documents  = [];
        if (empty($filters))
            $filters = 'findAll';
        $this->documents = $this->databaseHandler->findAll()->getDocuments();
        if ($filters !== 'findAll')
            $this->filter($filters);
        $this->sort();
        $this->offsetLimit();
        if (is_array($this->fields) && !empty($this->fields))
        {
            foreach($this->documents as $index => $document)
            {
                $fields = new \stdClass();
                foreach($this->fields as $fieldTarget)
                    $fields->{$fieldTarget} = $document->{$fieldTarget};
                $this->documents[$index] = $fields;
            }
        }
        $this->databaseHandler->setDocuments($this->documents);
        return $this->databaseHandler;
    }
961968
def iterator(self):
        

        for item in self.query.results():
            obj = self.resource(**item)

            yield obj
242608
public Iterator<Row> iterator()
    {
        if (this.rows != null)
        {
            return Arrays.asList(this.rows).iterator();
        }
        else
        {
            return ConvertibleIteratorUtils.iterateAsRow(this.pbRows.iterator(), this.pbColumnDescriptions);
        }
    }
104152
@Override
    public Iterator<T> iterator() {
        return outputType == OutputType.INLINE ? getInlineResults() : createQuery().fetch().iterator();
    }
62809
public function getIterator()
    {
        $els = parent::getIterator();

        return new CallbackFilterIterator($els, function (&$current) {
                /** @var EntityProxy $current */
                $current = $current->getProxy();

                return true;
            }
        );
    }