|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface QueryCondition
Specifies the conditions to be added to a given query. For example, you can use this interface to limit the results of your query, or constrain the query to return results within a particular range.
A Query is made up of query result objects, query condition objects, and query scope objects. To
add query condition objects to a query, you construct a QueryCondition instance. Once you have
constructed a QueryCondition instance, you then add it to a Query.
A QueryCondition instance contains an array of ConditionBase instances. The ConditionBase
interface is a parent interface for Filter, PreCondition, Rank, SubQuery, and [notably]
QueryCondition. So, to add a filter condition to the query, you would create a Filter instance, and then
add it to the ConditionBase array for this QueryCondition instance. Furthermore, if you
want to add additional query conditions to the query, you can add a QueryCondition instance to the ConditionBase
array.
You can also add a PreConditionObject object found in the Universe to a query condition. See
PreCondition for information on how to add a PreConditionObject
to a query condition.
Example: Creating a custom query condition.
Note: This example assumes that you have created a QueryObject array called
boQueryResultObjects that contains query result object keys from the Universe.
QuerySpecification boQuerySpec = QuerySpecification.Factory.newInstance();
Query boQuery1 = Query.Factory.newInstance();
QueryCondition boQueryCondition = QueryCondition.Factory.newInstance();
Filter boCondFilter = Filter.Factory.newInstance();
QueryObject boQueryConditionObject = QueryObject.Factory.newInstance();
boQueryConditionObject.setKey((String)dimensionKeys.get(0));
boCondFilter.setFilteredObject(boQueryConditionObject);
boCondFilter.setFilterOperator(FilterOperator.EQUAL);
Operand[] boConditionValues = new Operand[1];
Values boFreeValues = Values.Factory.newInstance();
String[] boConditionValueString = new String[] {"France"};
boFreeValues.setFreeValueArray(boConditionValueString);
boConditionValues[0] = boFreeValues;
boCondFilter.setOperandArray(boConditionValues);
ConditionBase[] boConditionBase = new ConditionBase[1];
boConditionBase[0] = boCondFilter;
boQueryCondition.setItemArray(boConditionBase);
boQuery1.setQueryCondition(boQueryCondition);
boQuery1.setQueryResultArray(boQueryResultObjects);
boQuerySpec.setQueryBase(boQuery1);
PreCondition,
PreConditionObject,
ConditionBase| Nested Class Summary | |
|---|---|
static class |
QueryCondition.Factory
A class with methods for creating instances of the QueryCondition type. |
| Field Summary | |
|---|---|
static org.apache.xmlbeans.SchemaType |
type
Internal Use Only. |
| Method Summary | |
|---|---|
ConditionBase |
addNewItem()
Appends and returns a new empty value (as xml) as the last Item element. |
ConditionBase[] |
getItemArray()
Gets the array of ConditionBase instances for this QueryCondition instance. |
ConditionBase |
getItemArray(int i)
Gets the ConditionBase instance at the position indexed by i. |
QueryConditionOperator.Enum |
getQueryConditionOperator()
Gets the operator used between the ConditionBase instances in the ConditionBase array. |
ConditionBase |
insertNewItem(int i)
Inserts and returns a new empty value (as xml) of the Item element at the specified index position. |
boolean |
isSetQueryConditionOperator()
Checks if the QueryConditionOperator attribute has been set. |
void |
removeItem(int i)
Removes the Item element a new empty value (as xml) of the Item element at the specified index position. |
void |
setItemArray(ConditionBase[] itemArray)
Sets the array of ConditionBase instances for this QueryCondition instance. |
void |
setItemArray(int i,
ConditionBase item)
Sets the ConditionBase instance to the array location indexed by i. |
void |
setQueryConditionOperator(QueryConditionOperator.Enum queryConditionOperator)
Sets the operator used between the ConditionBase instances in the ConditionBase array. |
int |
sizeOfItemArray()
Returns the size of the Item array. |
void |
unsetQueryConditionOperator()
Deletes or unsets the QueryConditionOperator attribute. |
QueryConditionOperator |
xgetQueryConditionOperator()
Internal Use Only. |
void |
xsetQueryConditionOperator(QueryConditionOperator queryConditionOperator)
Internal Use Only. |
| Methods inherited from interface com.businessobjects.query.ConditionBase |
|---|
getID, isSetID, setID, unsetID, xgetID, xsetID |
| Field Detail |
|---|
static final org.apache.xmlbeans.SchemaType type
Internal Use Only.
| Method Detail |
|---|
ConditionBase[] getItemArray()
Gets the array of ConditionBase instances for this QueryCondition instance.
The ConditionBase
class is a parent class for Filter, PreCondition, Rank, SubQuery, and [notably]
QueryCondition.
ConditionBase instances for this QueryConditionConditionBase getItemArray(int i)
Gets the ConditionBase instance at the position indexed by i.
The ConditionBase
class is a parent class for Filter, PreCondition, Rank, SubQuery, and [notably]
QueryCondition.
i - an int used to reference a location in the array.
ConditionBase instance at array position i.int sizeOfItemArray()
void setItemArray(ConditionBase[] itemArray)
Sets the array of ConditionBase instances for this QueryCondition instance.
The ConditionBase
class is a parent class for Filter, PreCondition, Rank, SubQuery, and [notably]
QueryCondition. So, to add a filter condition to the query, you would create a Filter instance, and then
add it to the ConditionBase array for this QueryCondition instance. Furthermore, if you
want to add additional query conditions to the query, you can add a QueryCondition instance to the ConditionBase
array.
item - an array of ConditionBase instances
void setItemArray(int i,
ConditionBase item)
Sets the ConditionBase instance to the array location indexed by i.
The ConditionBase
class is a parent class for Filter, PreCondition, Rank, SubQuery, and [notably]
QueryCondition. So, to add a filter condition to the query, you would create a Filter instance, and then
add it to the ConditionBase array for this QueryCondition instance. Furthermore, if you
want to add additional query conditions to the query, you can add a QueryCondition instance to the ConditionBase
array.
i - an int used to reference a location in the arrayvalue - a ConditionBase instance to put in the arrayConditionBase insertNewItem(int i)
i - the index of the Item element
ConditionBase addNewItem()
void removeItem(int i)
i - the index of the Item element.QueryConditionOperator.Enum getQueryConditionOperator()
Gets the operator used between the ConditionBase instances in the ConditionBase array.
For example, if there are two conditions in the ConditionBase array (such as a filter and a prompt),
you would set the QueryConditionOperator to "AND" if you want the result to include data where
both conditions are true, or "OR" if you want the result to contain data where either condition is true.
QueryConditionOperator set for this QueryCondition instanceQueryConditionOperator xgetQueryConditionOperator()
Internal Use Only.
boolean isSetQueryConditionOperator()
true if the QueryConditionOperator element is set, otherwise falsevoid setQueryConditionOperator(QueryConditionOperator.Enum queryConditionOperator)
Sets the operator used between the ConditionBase instances in the ConditionBase array.
For example, if there are two conditions in the ConditionBase array (such as a filter and a prompt),
you would set the QueryConditionOperator to "AND" if you want the result to include data where
both conditions are true, or "OR" if you want the result to contain data where either condition is true.
queryConditionOperator - the QueryConditionOperator to use between the conditions in the ConditionBase arrayvoid xsetQueryConditionOperator(QueryConditionOperator queryConditionOperator)
Internal Use Only.
void unsetQueryConditionOperator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||