Class BaseQuery<T>

java.lang.Object
org.infinispan.query.dsl.impl.BaseQuery<T>
All Implemented Interfaces:
Iterable<T>, org.infinispan.commons.api.query.Query<T>, Query<T>

public abstract class BaseQuery<T> extends Object implements Query<T>
Since:
7.2
Author:
anistor@redhat.com
  • Field Details

    • queryFactory

      protected final QueryFactory queryFactory
    • queryString

      protected final String queryString
    • namedParameters

      protected Map<String,Object> namedParameters
    • projection

      protected final String[] projection
    • startOffset

      protected int startOffset
    • maxResults

      protected int maxResults
    • hitCountAccuracy

      protected Integer hitCountAccuracy
    • local

      protected boolean local
    • scoreRequired

      protected boolean scoreRequired
    • timeout

      protected long timeout
      Optional timeout in nanoseconds.
  • Constructor Details

  • Method Details

    • getQueryString

      public String getQueryString()
      Returns the Ickle query string.
      Specified by:
      getQueryString in interface org.infinispan.commons.api.query.Query<T>
      Returns:
      the Ickle query string
    • getParameters

      public Map<String,Object> getParameters()
      Specified by:
      getParameters in interface org.infinispan.commons.api.query.Query<T>
    • setParameter

      public Query<T> setParameter(String paramName, Object paramValue)
      Specified by:
      setParameter in interface org.infinispan.commons.api.query.Query<T>
      Specified by:
      setParameter in interface Query<T>
    • setParameters

      public Query<T> setParameters(Map<String,Object> paramValues)
      Specified by:
      setParameters in interface org.infinispan.commons.api.query.Query<T>
      Specified by:
      setParameters in interface Query<T>
    • resetQuery

      public abstract void resetQuery()
      Reset internal state after pagination or query parameters are modified. This is needed to ensure the next execution of the query uses the new values.
    • validateNamedParameters

      public void validateNamedParameters()
      Ensure all named parameters have non-null values.
    • getProjection

      public String[] getProjection()
      Specified by:
      getProjection in interface Query<T>
      Returns:
      the values for query projections or null if the query does not have projections.
    • hasProjections

      public boolean hasProjections()
      Specified by:
      hasProjections in interface org.infinispan.commons.api.query.Query<T>
    • getStartOffset

      public long getStartOffset()
      Specified by:
      getStartOffset in interface org.infinispan.commons.api.query.Query<T>
    • getMaxResults

      public int getMaxResults()
      Specified by:
      getMaxResults in interface org.infinispan.commons.api.query.Query<T>
    • startOffset

      public Query<T> startOffset(long startOffset)
      Specified by:
      startOffset in interface org.infinispan.commons.api.query.Query<T>
      Specified by:
      startOffset in interface Query<T>
    • maxResults

      public Query<T> maxResults(int maxResults)
      Specified by:
      maxResults in interface org.infinispan.commons.api.query.Query<T>
      Specified by:
      maxResults in interface Query<T>
    • hitCountAccuracy

      public Integer hitCountAccuracy()
      Specified by:
      hitCountAccuracy in interface org.infinispan.commons.api.query.Query<T>
    • hitCountAccuracy

      public Query<T> hitCountAccuracy(int hitCountAccuracy)
      Specified by:
      hitCountAccuracy in interface org.infinispan.commons.api.query.Query<T>
      Specified by:
      hitCountAccuracy in interface Query<T>
    • local

      public Query<T> local(boolean local)
      Specified by:
      local in interface org.infinispan.commons.api.query.Query<T>
    • isLocal

      public boolean isLocal()
    • scoreRequired

      public Query<T> scoreRequired(boolean scoreRequired)
      Specified by:
      scoreRequired in interface org.infinispan.commons.api.query.Query<T>
    • timeout

      public Query<T> timeout(long timeout, TimeUnit timeUnit)
      Specified by:
      timeout in interface org.infinispan.commons.api.query.Query<T>
      Specified by:
      timeout in interface Query<T>
    • entryIterator

      public <K> org.infinispan.commons.api.query.ClosableIteratorWithCount<org.infinispan.commons.api.query.EntityEntry<K,T>> entryIterator(boolean withMetadata)
      Specified by:
      entryIterator in interface org.infinispan.commons.api.query.Query<T>
    • executeStatement

      public int executeStatement()
      Specified by:
      executeStatement in interface org.infinispan.commons.api.query.Query<T>