Class RemoteQuery<T>
- java.lang.Object
-
- org.infinispan.query.dsl.impl.BaseQuery<T>
-
- org.infinispan.client.hotrod.impl.query.RemoteQuery<T>
-
- All Implemented Interfaces:
Iterable<T>,PaginationContext<Query<T>>,ParameterContext<Query<T>>,Query<T>
public final class RemoteQuery<T> extends BaseQuery<T>
- Since:
- 6.0
- Author:
- anistor@redhat.com
-
-
Field Summary
-
Fields inherited from class org.infinispan.query.dsl.impl.BaseQuery
hitCountAccuracy, local, maxResults, namedParameters, projection, queryFactory, queryString, startOffset, timeout
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryResult<T>execute()Executes the query (a SELECT statement).intexecuteStatement()Executes a data modifying statement (typically a DELETE) that does not return results; instead it returns an affected entries count.RemoteCache<?,?>getCache()intgetResultSize()Gets the total number of results matching the query, ignoring pagination (startOffset, maxResults).SerializationContextgetSerializationContext()Get the protobuf SerializationContext ornullif we are not using protobuf.CloseableIterator<T>iterator()Returns aCloseableIteratorover the results.List<T>list()Returns the results of a search as a list.voidresetQuery()Reset internal state after pagination or query parameters are modified.StringtoString()-
Methods inherited from class org.infinispan.query.dsl.impl.BaseQuery
entryIterator, getMaxResults, getParameters, getProjection, getQueryString, getStartOffset, hasProjections, hitCountAccuracy, hitCountAccuracy, isLocal, local, maxResults, setParameter, setParameters, startOffset, timeout, validateNamedParameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
resetQuery
public void resetQuery()
Description copied from class:BaseQueryReset internal state after pagination or query parameters are modified. This is needed to ensure the next execution of the query uses the new values.- Specified by:
resetQueryin classBaseQuery<T>
-
list
public List<T> list()
Description copied from interface:QueryReturns the results of a search as a list.- Returns:
- list of objects that were found from the search.
-
execute
public QueryResult<T> execute()
Description copied from interface:QueryExecutes the query (a SELECT statement). Subsequent invocations cause the query to be re-executed.Executing a DELETE is also allowed. No results will be returned in this case but the number of affected entries will be returned as the hit count in the
QueryResult.- Returns:
QueryResultwith the results.
-
executeStatement
public int executeStatement()
Description copied from interface:QueryExecutes a data modifying statement (typically a DELETE) that does not return results; instead it returns an affected entries count. This method cannot be used to execute a SELECT.NOTE: Paging params (firstResult/maxResults) are NOT allowed.
- Specified by:
executeStatementin interfaceQuery<T>- Overrides:
executeStatementin classBaseQuery<T>- Returns:
- the number of affected (deleted) entries
-
iterator
public CloseableIterator<T> iterator()
Description copied from interface:QueryReturns aCloseableIteratorover the results. Please close the iterator when you are done with processing the results.- Returns:
- the results of the query as an iterator.
-
getResultSize
public int getResultSize()
Description copied from interface:QueryGets the total number of results matching the query, ignoring pagination (startOffset, maxResults).- Returns:
- total number of results.
-
getSerializationContext
public SerializationContext getSerializationContext()
Get the protobuf SerializationContext ornullif we are not using protobuf.
-
getCache
public RemoteCache<?,?> getCache()
-
-