Interface QueryExecute<T>
-
- All Superinterfaces:
Iterable<T>
,QueryResultIterable<T>
- All Known Subinterfaces:
Loader
,LoadType<T>
,Query<T>
,QueryKeys<T>
,SimpleQuery<T>
- All Known Implementing Classes:
QueryImpl
,SimpleQueryImpl
public interface QueryExecute<T> extends QueryResultIterable<T>
Most of the various methods that can end the definition of a query and start execution. The first() method is excluded because it returns a Refwhich encapsulates both the regular and keys-only result. It makes no sense to have a Ref >, but when you do keys() you get a QueryExecute >. - Author:
- Jeff Schnitzer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LoadResult<T>
first()
Gets the first entity in the result set.QueryResultIterable<T>
iterable()
Starts an asynchronous query which will return entities.List<T>
list()
Execute the query and get the results as a List.String
toString()
Generates a string that consistently and uniquely specifies this query.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.googlecode.objectify.cmd.QueryResultIterable
iterator
-
-
-
-
Method Detail
-
iterable
QueryResultIterable<T> iterable()
Starts an asynchronous query which will return entities.
Note that since the Query
itself is QueryResultIterable , you can iterate on the query object itself. However, if you want to start an async query and iterate on it later, you can use this method.
-
list
List<T> list()
Execute the query and get the results as a List. The list will be equivalent to a simple ArrayList; you can iterate through it multiple times without incurring additional datastore cost.
Note that you must be careful about limit()ing the size of the list returned; you can easily exceed the practical memory limits of Appengine by querying for a very large dataset.
-
first
LoadResult<T> first()
Gets the first entity in the result set. Obeys the offset value.- Returns:
- an asynchronous result containing the first result. The result will hold null if the result set is empty.
-
toString
String toString()
Generates a string that consistently and uniquely specifies this query. There is no way to convert this string back into a query and there is no guarantee that the string will be consistent across versions of Objectify.
In particular, this value is useful as a key for a simple memcache query cache.
-
-