Package org.infinispan.query.dsl
Interface Query<T>
- All Superinterfaces:
Iterable<T>,org.infinispan.commons.api.query.Query<T>
- All Known Implementing Classes:
BaseQuery
public interface Query<T>
extends org.infinispan.commons.api.query.Query<T>
An immutable object representing both the query and the result. The result is obtained lazily when one of the methods
in this interface is executed first time. The query is executed only once. Further calls will just return the
previously cached results. If you intend to re-execute the query to obtain fresh data you need to build another
instance using a
QueryBuilder.- Since:
- 6.0
- Author:
- anistor@redhat.com
-
Method Summary
Modifier and TypeMethodDescriptionexecute()String[]Deprecated.since 11.0.intDeprecated.since 10.1.hitCountAccuracy(int hitCountAccuracy) maxResults(int maxResults) setParameter(String paramName, Object paramValue) setParameters(Map<String, Object> paramValues) startOffset(long startOffset) Methods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.infinispan.commons.api.query.Query
entryIterator, executeStatement, getMaxResults, getParameters, getQueryString, getStartOffset, hasProjections, hitCountAccuracy, iterator, list, local, scoreRequired
-
Method Details
-
execute
QueryResult<T> execute()- Specified by:
executein interfaceorg.infinispan.commons.api.query.Query<T>
-
getResultSize
Deprecated.since 10.1. This will be removed in 12. It's closest replacement isQueryResult.hitCount()which returns an optional long.Gets the total number of results matching the query, ignoring pagination (startOffset, maxResults).- Returns:
- total number of results.
-
getProjection
Deprecated.since 11.0. This method will be removed in next major version. To find out if a query uses projections useQuery.hasProjections()- Returns:
- the values for query projections or
nullif the query does not have projections.
-
startOffset
- Specified by:
startOffsetin interfaceorg.infinispan.commons.api.query.Query<T>
-
maxResults
- Specified by:
maxResultsin interfaceorg.infinispan.commons.api.query.Query<T>
-
hitCountAccuracy
- Specified by:
hitCountAccuracyin interfaceorg.infinispan.commons.api.query.Query<T>
-
setParameter
- Specified by:
setParameterin interfaceorg.infinispan.commons.api.query.Query<T>
-
setParameters
- Specified by:
setParametersin interfaceorg.infinispan.commons.api.query.Query<T>
-
timeout
- Specified by:
timeoutin interfaceorg.infinispan.commons.api.query.Query<T>
-