When the type of the results is known the preferred usage would be:
Query<Entity>query=Query.newGqlQueryBuilder(Query.ResultType.ENTITY,"select * from kind").build();QueryResults<Entity>results=datastore.run(query);while(results.hasNext()){Entityentity=results.next();...}
When the type of the results is unknown you can use this approach:
Queryquery=Query.newGqlQueryBuilder("select __key__ from kind").build();QueryResultsresults=datastore.run(query);if(Key.class.isAssignableFrom(results.getResultClass())){QueryResults<Key>keys=(QueryResults<Key>)results;while(keys.hasNext()){Keykey=keys.next();...}}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-05 UTC."],[],[]]