Class Query<R>

    • Method Detail

      • getSelectSingle

        public Selectable<? extends R> getSelectSingle()
      • setSelect

        public void setSelect​(Selectable<? extends R> select)
      • setSelects

        public void setSelects​(Selectable<?>... selects)
      • isDistinct

        public boolean isDistinct()
      • setDistinct

        public void setDistinct​(boolean distinct)
      • getType

        public Type<?> getType()
      • setCondition

        public void setCondition​(Condition condition)
      • getCondition

        public Condition getCondition()
      • narrow

        public void narrow​(Condition narrowingCondition)
        If there is already a condition set for this query, this is equivalent to {@link #setCondition(Condition) setCondition}({@link #getCondition()}.{@link Condition#and(Condition) and}(narrowingCondition)).
      • join

        public Join join​(Type<?> type)
        Does an inner join with the given type without any join condition.
      • join

        public Join join​(Type<?> type,
                         Condition condition)
        Does an inner join with the given type on the given join condition.
      • joinOuterRight

        public Join joinOuterRight​(Type<?> type,
                                   Condition condition)
      • getJoins

        public List<Join> getJoins()
      • setGroupBy

        public void setGroupBy​(Selectable<?>... groupBy)
      • setHaving

        public void setHaving​(Condition having)
      • getOrderByFunctions

        public List<Selectable<?>> getOrderByFunctions()
      • getOrderByAscending

        public List<Boolean> getOrderByAscending()
      • setOrderByThis

        public void setOrderByThis​(boolean ascending)
      • setOrderBy

        public void setOrderBy​(Selectable<?> orderBy,
                               boolean ascending)
      • setOrderByAndThis

        public void setOrderByAndThis​(Selectable<?> orderBy,
                                      boolean ascending)
      • addOrderBy

        public void addOrderBy​(Selectable<?> orderBy)
      • addOrderByDescending

        public void addOrderByDescending​(Selectable<?> orderBy)
      • addOrderBy

        public void addOrderBy​(Selectable<?> orderBy,
                               boolean ascending)
      • resetOrderBy

        public void resetOrderBy()
      • getPageOffset

        public int getPageOffset()
      • getPageLimitOrMinusOne

        public int getPageLimitOrMinusOne()
      • setSearchSizeLimit

        public void setSearchSizeLimit​(int searchSizeLimit)
        Sets the search size limit for this query.

        Method search() will fail with an IllegalStateException as soon as the size of the result set exceeds the search size limit. Method total() is not affected by this limit.

        Setting the search size limit does not guarantee, that search() actually fails when exceeding the limit. But it is guaranteed, that it does not fail when not exceeding the limit. In particular, it may not fail, if the result is fetched from the query cache.

        If search size limit is not set, it defaults to ConnectProperties.getQuerySearchSizeLimit().

        See Also:
        getSearchSizeLimit()
      • setSearchSizeCacheLimit

        public void setSearchSizeCacheLimit​(int searchSizeCacheLimit)
        Sets the search size cache limit for this query.

        Results of method search() will not be considered for inclusion into query cache as soon as the size of the result set exceeds the search size cache limit. Method total() is not affected by this limit.

        Setting the search size cache limit does not guarantee, that search() is not satisfied from the cache.

        If search size cache limit is not set, it defaults to ConnectProperties.getQueryCacheSizeLimit().

        See Also:
        getSearchSizeCacheLimit()
      • search

        public List<R> search()
        Searches for items matching this query.

        Returns an unmodifiable collection. Any attempts to modify the returned collection, whether direct or via its iterator, result in an UnsupportedOperationException.

      • total

        public int total()
        Counts the items matching this query.

        Returns the size of what search() would have returned for this query with setPageUnlimited(int) reset set to (0).

      • searchAndTotal

        public Query.Result<R> searchAndTotal()
        Searches for items matching this query.

        Returns a Query.Result containing the data and the total. The data is equal to what search() would have returned for this query. The total is equal to what total() would have returned for this query.

        This method does it's best to avoid issuing two queries for searching and totaling.

      • setOrderBy

        public void setOrderBy​(Function<?> orderBy,
                               boolean ascending)
      • setOrderByAndThis

        public void setOrderByAndThis​(Function<?> orderBy,
                                      boolean ascending)
      • setOrderBy

        public void setOrderBy​(Function<?>[] orderBy,
                               boolean[] ascending)
      • addOrderBy

        public void addOrderBy​(Function<?> orderBy)
      • addOrderByDescending

        public void addOrderByDescending​(Function<?> orderBy)
      • addOrderBy

        public void addOrderBy​(Function<?> orderBy,
                               boolean ascending)
      • countWithoutLimit

        @Deprecated
        public int countWithoutLimit()
        Deprecated.
        Use total() instead