public abstract class QueryProcessor<T>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
QueryProcessor.Metrics |
Modifier and Type | Field and Description |
---|---|
protected int |
start |
protected com.google.inject.Provider<CurrentUser> |
userProvider |
Modifier | Constructor and Description |
---|---|
protected |
QueryProcessor(com.google.inject.Provider<CurrentUser> userProvider,
QueryProcessor.Metrics metrics,
SchemaDefinitions<T> schemaDef,
IndexConfig indexConfig,
IndexCollection<?,T,? extends Index<?,T>> indexes,
IndexRewriter<T> rewriter,
java.lang.String limitField) |
Modifier and Type | Method and Description |
---|---|
protected QueryOptions |
createOptions(IndexConfig indexConfig,
int start,
int limit,
java.util.Set<java.lang.String> requestedFields) |
QueryProcessor<T> |
enforceVisibility(boolean enforce) |
protected abstract Predicate<T> |
enforceVisibility(Predicate<T> pred)
Invoked after the query was rewritten.
|
boolean |
isDisabled() |
java.util.List<QueryResult<T>> |
query(java.util.List<Predicate<T>> queries) |
QueryResult<T> |
query(Predicate<T> query)
Query for entities that match a structured query.
|
QueryProcessor<T> |
setLimit(int n) |
QueryProcessor<T> |
setRequestedFields(java.util.Set<java.lang.String> fields) |
QueryProcessor<T> |
setStart(int n) |
protected final com.google.inject.Provider<CurrentUser> userProvider
protected int start
protected QueryProcessor(com.google.inject.Provider<CurrentUser> userProvider, QueryProcessor.Metrics metrics, SchemaDefinitions<T> schemaDef, IndexConfig indexConfig, IndexCollection<?,T,? extends Index<?,T>> indexes, IndexRewriter<T> rewriter, java.lang.String limitField)
public QueryProcessor<T> setStart(int n)
public QueryProcessor<T> enforceVisibility(boolean enforce)
public QueryProcessor<T> setLimit(int n)
public QueryProcessor<T> setRequestedFields(java.util.Set<java.lang.String> fields)
public QueryResult<T> query(Predicate<T> query) throws com.google.gwtorm.server.OrmException, com.google.gerrit.server.query.QueryParseException
query
- the query.com.google.gwtorm.server.OrmException
com.google.gerrit.server.query.QueryParseException
query(List)
public java.util.List<QueryResult<T>> query(java.util.List<Predicate<T>> queries) throws com.google.gwtorm.server.OrmException, com.google.gerrit.server.query.QueryParseException
com.google.gwtorm.server.OrmException
com.google.gerrit.server.query.QueryParseException
protected QueryOptions createOptions(IndexConfig indexConfig, int start, int limit, java.util.Set<java.lang.String> requestedFields)
protected abstract Predicate<T> enforceVisibility(Predicate<T> pred)
pred
- the querypublic boolean isDisabled()