Class InternalQuery<T>

  • Direct Known Subclasses:
    InternalAccountQuery, InternalChangeQuery, InternalGroupQuery

    public class InternalQuery<T>
    extends Object
    Execute a single query over a secondary index, for use by Gerrit internals.

    By default, visibility of returned entities is not enforced (unlike in QueryProcessor). The methods in this class are not typically used by user-facing paths, but rather by internal callers that need to process all matching results.

    Instances are one-time-use. Other singleton classes should inject a Provider rather than holding on to a single instance.

    • Field Detail

    • Method Detail

      • enforceVisibility

        public InternalQuery<T> enforceVisibility​(boolean enforce)
      • query

        public List<T> query​(Predicate<T> p)
                      throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • query

        public List<List<T>> query​(List<Predicate<T>> queries)
                            throws com.google.gwtorm.server.OrmException
        Run multiple queries in parallel.

        If a limit was specified using setLimit(int), that limit is applied to each query independently.

        Parameters:
        queries - list of queries.
        Returns:
        results of the queries, one list of results per input query, in the same order as the input.
        Throws:
        com.google.gwtorm.server.OrmException
      • schema

        protected Schema<T> schema()