All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.query.dsl.Query Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.query.dsl;

import java.util.List;
import java.util.Map;

/**
 * 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 {@link QueryBuilder}.
 *
 * @author [email protected]
 * @since 6.0
 */
public interface Query {

   Query setParameter(String paramName, Object paramValue);

   Query setParameters(Map paramValues);

   /**
    * Returns the results of a search as a list.
    *
    * @return list of objects that were found from the search.
    */
    List list();

   /**
    * Gets the total number of results matching the query, ignoring pagination (firstResult, maxResult).
    *
    * @return total number of results.
    */
   int getResultSize(); //todo [anistor] this should probably be a long?

   //todo [anistor] also add long getStartOffset() ?
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy