Class AbstractQuery<T extends Query<?,​?>,​U>

    • Field Detail

      • expressions

        protected java.util.Map<java.lang.String,​java.lang.String> expressions
      • maxResultsLimitEnabled

        protected boolean maxResultsLimitEnabled
    • Constructor Detail

      • AbstractQuery

        protected AbstractQuery()
      • AbstractQuery

        protected AbstractQuery​(CommandExecutor commandExecutor)
    • Method Detail

      • asc

        public T asc()
        Description copied from interface: Query
        Order the results ascending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods).
        Specified by:
        asc in interface Query<T extends Query<?,​?>,​U>
      • desc

        public T desc()
        Description copied from interface: Query
        Order the results descending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods).
        Specified by:
        desc in interface Query<T extends Query<?,​?>,​U>
      • direction

        public T direction​(Direction direction)
      • checkQueryOk

        protected void checkQueryOk()
      • singleResult

        public U singleResult()
        Description copied from interface: Query
        Executes the query and returns the resulting entity or null if no entity matches the query criteria.
        Specified by:
        singleResult in interface Query<T extends Query<?,​?>,​U>
      • list

        public java.util.List<U> list()
        Description copied from interface: Query
        Executes the query and get a list of entities as the result.
        Specified by:
        list in interface Query<T extends Query<?,​?>,​U>
        Returns:
        a list of results
      • listPage

        public java.util.List<U> listPage​(int firstResult,
                                          int maxResults)
        Description copied from interface: Query
        Executes the query and get a list of entities as the result.
        Specified by:
        listPage in interface Query<T extends Query<?,​?>,​U>
        Parameters:
        firstResult - the index of the first result
        maxResults - the maximum number of results
        Returns:
        a list of results
      • count

        public long count()
        Description copied from interface: Query
        Executes the query and returns the number of results
        Specified by:
        count in interface Query<T extends Query<?,​?>,​U>
      • unlimitedList

        public java.util.List<U> unlimitedList()
        Description copied from interface: Query
        Executes the query. No limitation checks are performed (e. g. query limit).
        Specified by:
        unlimitedList in interface Query<T extends Query<?,​?>,​U>
        Returns:
        a list of results
      • evaluateExpressionsAndExecuteCount

        public long evaluateExpressionsAndExecuteCount​(CommandContext commandContext)
      • executeCount

        public abstract long executeCount​(CommandContext commandContext)
      • evaluateExpressionsAndExecuteList

        public java.util.List<U> evaluateExpressionsAndExecuteList​(CommandContext commandContext,
                                                                   Page page)
      • hasExcludingConditions

        protected boolean hasExcludingConditions()
        Whether or not the query has excluding conditions. If the query has excluding conditions, (e.g. task due date before and after are excluding), the SQL query is avoided and a default result is returned. The returned result is the same as if the SQL was executed and there were no entries.
        Returns:
        true if the query does have excluding conditions, false otherwise
      • executeList

        public abstract java.util.List<U> executeList​(CommandContext commandContext,
                                                      Page page)
        Executes the actual query to retrieve the list of results.
        Parameters:
        page - used if the results must be paged. If null, no paging will be applied.
      • executeSingleResult

        public U executeSingleResult​(CommandContext commandContext)
      • getExpressions

        public java.util.Map<java.lang.String,​java.lang.String> getExpressions()
      • setExpressions

        public void setExpressions​(java.util.Map<java.lang.String,​java.lang.String> expressions)
      • addExpression

        public void addExpression​(java.lang.String key,
                                  java.lang.String expression)
      • evaluateExpressions

        protected void evaluateExpressions()
      • getMethod

        protected java.lang.reflect.Method getMethod​(java.lang.String methodName)
      • extend

        public T extend​(T extendingQuery)
      • mergeExpressions

        protected void mergeExpressions​(AbstractQuery<?,​?> extendedQuery,
                                        AbstractQuery<?,​?> extendingQuery)
      • validate

        public void validate()
      • listIds

        public java.util.List<java.lang.String> listIds()
      • listDeploymentIdMappings

        public java.util.List<ImmutablePair<java.lang.String,​java.lang.String>> listDeploymentIdMappings()
      • evaluateExpressionsAndExecuteIdsList

        public java.util.List<java.lang.String> evaluateExpressionsAndExecuteIdsList​(CommandContext commandContext)
      • executeIdsList

        public java.util.List<java.lang.String> executeIdsList​(CommandContext commandContext)
      • evaluateExpressionsAndExecuteDeploymentIdMappingsList

        public java.util.List<ImmutablePair<java.lang.String,​java.lang.String>> evaluateExpressionsAndExecuteDeploymentIdMappingsList​(CommandContext commandContext)
      • executeDeploymentIdMappingsList

        public java.util.List<ImmutablePair<java.lang.String,​java.lang.String>> executeDeploymentIdMappingsList​(CommandContext commandContext)
      • checkMaxResultsLimit

        protected void checkMaxResultsLimit()
      • enableMaxResultsLimit

        public void enableMaxResultsLimit()
      • disableMaxResultsLimit

        public void disableMaxResultsLimit()