code: public <E> QueryResponse<E> executeEntityQueryRequest(Class<E> expectedResultType,
        EntityQueryRequest request) {
      try {
        GqlQuery.Builder<Entity> queryBuilder = Query.newGqlQueryBuilder(ResultType.ENTITY,
            request.getQuery());
        queryBuilder.setNamespace(entityManager.getEffectiveNamespace());
        queryBuilder.setAllowLiteral(request.isAllowLiterals());
        QueryUtils.applyNamedBindings(queryBuilder, request.getNamedBindings());
        QueryUtils.applyPositionalBindings(queryBuilder, request.getPositionalBindings());
        GqlQuery<Entity> gqlQuery = queryBuilder.build();
        QueryResults<Entity> results = nativeReader.run(gqlQuery);
        List<E> entities = new ArrayList<>();
        DefaultQueryResponse<E> response = new DefaultQueryResponse<>();
        response.setStartCursor(new DefaultDatastoreCursor(results.getCursorAfter().toUrlSafe()));
        while (results.hasNext()) {
          Entity result = results.next();
          E entity = Unmarshaller.unmarshal(result, expectedResultType);
          entities.add(entity);
        }
        response.setResults(entities);
        response.setEndCursor(new DefaultDatastoreCursor(results.getCursorAfter().toUrlSafe()));
        response.setQueryResponseMetadata(
            new DefaultQueryResponseMetadata(
                QueryResponseMetadata.QueryState.forMoreResultsType(results.getMoreResults())));
        entityManager.executeEntityListeners(CallbackType.POST_LOAD, entities);
        return response;
      } catch (DatastoreException exp) {
        throw new EntityManagerException(exp);
      }
    }
docs: Executes the given {@link EntityQueryRequest} and returns the response.
  
  @param expectedResultType
  the expected type of results.
  @param request
  the entity query request
  @return the query response