com.atlassian.jira.jql.query
Interface OperatorSpecificQueryFactory

All Known Implementing Classes:
AbstractEqualityQueryFactory, ActualValueEqualityQueryFactory, ActualValueRelationalQueryFactory, DateEqualityQueryFactory, DateRelationalQueryFactory, EqualityQueryFactory, EqualityWithSpecifiedEmptyValueQueryFactory, LikeQueryFactory, RelationalOperatorIdIndexValueQueryFactory, RelationalOperatorMutatedIndexValueQueryFactory, VersionSpecificRelationalOperatorQueryFactory

public interface OperatorSpecificQueryFactory

An abstraction for the creation of a Query from an expression and operator. Because our Lucene index cannot support all operator-field combinations, we need to implement this in different ways for different fields.

Since:
v4.0

Method Summary
 QueryFactoryResult createQueryForEmptyOperand(String fieldName, Operator operator)
          Generates the query for an operand that has an OperandHandler that returns true for the isEmpty method.
 QueryFactoryResult createQueryForMultipleValues(String fieldName, Operator operator, List<QueryLiteral> rawValues)
          Generates the Query for a list of operand ids.
 QueryFactoryResult createQueryForSingleValue(String fieldName, Operator operator, List<QueryLiteral> rawValues)
          Generates the Query for a single operand id.
 boolean handlesOperator(Operator operator)
           
 

Method Detail

createQueryForSingleValue

QueryFactoryResult createQueryForSingleValue(String fieldName,
                                             Operator operator,
                                             List<QueryLiteral> rawValues)
Generates the Query for a single operand id.

Parameters:
fieldName - the index field name the query should be generated for.
operator - operator which is handled by this implementation.
rawValues - the raw values provided to the operand that need to be converted to index values.
Returns:
the queryFactoryResult that contains the query and the metadata.
Throws:
OperatorDoesNotSupportOperand - if the method is passed an operator that it can not handle. In this case the handlesOperator(com.atlassian.query.operator.Operator) call will have returned false.
OperatorDoesNotSupportSingleOperand - if the implementation does not support the operator for single values.

createQueryForMultipleValues

QueryFactoryResult createQueryForMultipleValues(String fieldName,
                                                Operator operator,
                                                List<QueryLiteral> rawValues)
Generates the Query for a list of operand ids.

Parameters:
fieldName - the index field name the query should be generated for.
operator - operator which is handled by this implementation.
rawValues - the raw values provided to the operand that need to be converted to index values.
Returns:
the queryFactoryResult that contains the query and the metadata.
Throws:
OperatorDoesNotSupportOperand - if the method is passed an operator that it can not handle. In this case the handlesOperator(com.atlassian.query.operator.Operator) call will have returned false.
OperatorDoesNotSupportMultiValueOperand - if the implementation does not support the operator for multiple values.

createQueryForEmptyOperand

QueryFactoryResult createQueryForEmptyOperand(String fieldName,
                                              Operator operator)
Generates the query for an operand that has an OperandHandler that returns true for the isEmpty method. This should generate a Lucene query that will perform the correct search for issues where the field value is not set.

Parameters:
fieldName - the index field name the query should be generated for.
operator - operator which is handled by this implementation.
Returns:
the queryFactoryResult that contains the query and the metadata.

handlesOperator

boolean handlesOperator(Operator operator)
Parameters:
operator - the operator in question.
Returns:
true if this implementation can handle the operator, false otherwise.


Copyright © 2002-2009 Atlassian. All Rights Reserved.