public abstract class

WorklogClauseQueryFactory

extends Object
implements ClauseQueryFactory
java.lang.Object
   ↳ com.atlassian.jira.jql.query.WorklogClauseQueryFactory
Known Direct Subclasses

Class Overview

This is a clause query factory for worklog clauses.

The implementation of method getQuery(com.atlassian.jira.jql.query.QueryCreationContext, com.atlassian.query.clause.TerminalClause) works in the standard way, i.e. it returns a query against the issue index, so you can use this class as any other ClauseQueryFactory.

One additional method is present, though. It is useful if you want to query worklog index directly and then process the results on your own.

Summary

Public Methods
@Nonnull final QueryFactoryResult getQuery(QueryCreationContext queryCreationContext, TerminalClause terminalClause)
Generates a lucene query for the passed TerminalClause.
abstract Query getWorklogQuery(QueryCreationContext queryCreationContext, TerminalClause terminalClause)
Returns a lucene query that can be run against the worklog index.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.jql.query.ClauseQueryFactory

Public Methods

@Nonnull public final QueryFactoryResult getQuery (QueryCreationContext queryCreationContext, TerminalClause terminalClause)

Generates a lucene query for the passed TerminalClause. It is the responsibility of the factory to look at the Operator and Operand in the TerminalClause and generate a Lucene search for it. This method is only called after JIRA works out that the TerminalClause is relevant to this ClauseQueryFactory.

A ClauseFactory needs to be careful when implementing the NOT_LIKE, NOT_EQUALS or NOT_IN operators. These negative operators should not match what is considered EMPTY. For example, the query "resolution is EMPTY" will return all unresolved issues in JIRA. The query "resolution != fixed" will only return all resolved issues that have not been resolved as "fixed", that is, it will not return any unresolved issues. The user would have to enter the query "resolution != fixed or resolution is EMPTY" to find all issues that are either unresolved or not resolved as "fixed".

The ClauseQueryFactory must handle the situation when an invalid TerminalClause is passed. The ClauseQueryFactory must return an empty Lucene Search if the passed TerminalClause is invalid. Most importantly, ClauseQueryFactory may not throw an exception on the input of an invalid TerminalClause.

Parameters
queryCreationContext the context of the query creation call; used to indicate that permissions should be ignored for "admin queries"
terminalClause the clause for which this factory is generating a query.
Returns
  • QueryFactoryResult contains the query that lucene can use to search and metadata about the query. Null cannot be returned.

public abstract Query getWorklogQuery (QueryCreationContext queryCreationContext, TerminalClause terminalClause)

Returns a lucene query that can be run against the worklog index.

Parameters
queryCreationContext query context
terminalClause clause to transform into query
Returns
  • lucene query against worklog index