|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CombinedQuery
Provides the ability to group a number of Query and CombinedQuery instances
into a single query. The main role of this interface is to provide the structure that enables you to create
complex queries. A CombinedQuery instance can contain both Query
and CombinedQuery objects, thus enabling you to create a complex query structure.
CombinedQuery can be used for the construction of the whole query for a given data provider, as
well as being used for representing a combination of queries.
The following example describes how to use the CombinedQuery interface to construct a complex query
made as one Query minus one CombinedQuery,
being itself made as an intersection between two Query instances.
Example: Constructing a complex query (Q1 MINUS (Q2 INTERSECT Q3)).
Note: This example assumes that you have obtained a DataSourceSpecification instance.
Additionally, it assumes that you have created three simple Query instances and have stored them in
variables called boQuery1, boQuery2, and boQuery3.
CombinedQuery boInnerCombinedQuery = CombinedQuery.Factory.newInstance();
boInnerCombinedQuery.setQueriesArray(new QueryBase[]{boQuery2,boQuery3});
boInnerCombinedQuery.setCombinedQueryOperator(CombinedQueryOperator.UNION);
CombinedQuery boOuterCombinedQuery = CombinedQuery.Factory.newInstance();
boOuterCombinedQuery.setQueriesArray(new QueryBase[]{boQuery1,boInnerCombinedQuery});
boOuterCombinedQuery.setCombinedQueryOperator(CombinedQueryOperator.INTERSECT);
QuerySpecification boQuerySpec = QuerySpecification.Factory.newInstance();
boQuerySpec.setQueryBase(boOuterCombinedQuery);
Query,
QueryObject| Nested Class Summary | |
|---|---|
static class |
CombinedQuery.Factory
A class with methods for creating instances of the CombinedQuery type. |
| Field Summary | |
|---|---|
static org.apache.xmlbeans.SchemaType |
type
Internal use only |
| Method Summary | |
|---|---|
QueryBase |
addNewQueries()
Appends and returns a new empty value (as xml) as the last Queries element. |
CombinedQueryOperator.Enum |
getCombinedQueryOperator()
Gets the CombinedQueryOperator used between the QueryBase instances
in this CombinedQuery instance. |
QueryBase[] |
getQueriesArray()
Gets the array of QueryBase instances for this CombinedQuery. |
QueryBase |
getQueriesArray(int i)
Gets the QueryBase instance located at index i in the QueryBase array
contained in this CombinedQuery instance. |
QueryBase |
insertNewQueries(int i)
Inserts and returns a new empty value (as xml) of the Queries element at the specified index position. |
boolean |
isNilQueriesArray(int i)
Checks if the Queries element is nil at the specified index position. |
boolean |
isSetCombinedQueryOperator()
Checks if the CombinedQueryOperator attribute has been set. |
void |
removeQueries(int i)
Removes the Queries element at the specified index position. |
void |
setCombinedQueryOperator(CombinedQueryOperator.Enum combinedQueryOperator)
Sets the CombinedQueryOperator to use between the QueryBase instances
in this CombinedQuery instance. |
void |
setNilQueriesArray(int i)
Nils the Queries element at the specified index position. |
void |
setQueriesArray(int i,
QueryBase queries)
Sets the QueryBase instance, value, into the QueryBase array at
the location specified by the index i. |
void |
setQueriesArray(QueryBase[] queriesArray)
Sets the array of QueryBase instances for this CombinedQuery. |
int |
sizeOfQueriesArray()
Returns the size of the Queries array. |
void |
unsetCombinedQueryOperator()
Deletes or unsets the CombinedQuery attribute. |
CombinedQueryOperator |
xgetCombinedQueryOperator()
Internal Use Only. |
void |
xsetCombinedQueryOperator(CombinedQueryOperator combinedQueryOperator)
Internal Use Only. |
| Methods inherited from interface com.businessobjects.query.QueryBase |
|---|
getID, isSetID, setID, unsetID, xgetID, xsetID |
| Field Detail |
|---|
static final org.apache.xmlbeans.SchemaType type
| Method Detail |
|---|
QueryBase[] getQueriesArray()
Gets the array of QueryBase instances for this CombinedQuery.
As the class QueryBase is an abstract one, the array of QueryBase contains
in fact instances of Query and CombinedQuery. It is
important to note that a given CombinedQuery instance can (but does not necessarily) contain additional
CombinedQuery instances.
QueryBase instances for this CombinedQueryQueryBase getQueriesArray(int i)
Gets the QueryBase instance located at index i in the QueryBase array
contained in this CombinedQuery instance.
i - the index of the QueryBase instance in the array.
QueryBase instance.boolean isNilQueriesArray(int i)
i - the index of the query instance in the array.
true if the query element is nil at ith position, otherwise falseint sizeOfQueriesArray()
void setQueriesArray(QueryBase[] queriesArray)
Sets the array of QueryBase instances for this CombinedQuery.
The Query class provides access to query result, query condition
and query scope objects from the Universe to a query.
You can group together a number of Query and of CombinedQuery instances
in a CombinedQuery object and set the operators to be used between them.
See Query for further information on how to create
Query instances.
Once you have created Query and CombinedQuery instances, use this
method to assign an array of them to a CombinedQuery instance.
Please note that the order you put your QueryBase instances in the array Queries
matters for the CombinedQueryOperator.Minus.
queriesArray - the array of QueryBase objects to put in this CombinedQuery
void setQueriesArray(int i,
QueryBase queries)
Sets the QueryBase instance, value, into the QueryBase array at
the location specified by the index i.
i - The index of the QueryBase array where the QueryBase instance is placed.queries - The QueryBase instance to place in the array.void setNilQueriesArray(int i)
i - The index of the queries elementQueryBase insertNewQueries(int i)
i - the index of the query element.
QueryBase addNewQueries()
void removeQueries(int i)
i - The index of the Queries element.CombinedQueryOperator.Enum getCombinedQueryOperator()
Gets the CombinedQueryOperator used between the QueryBase instances
in this CombinedQuery instance.
For example, if this CombinedQuery instance contains a CombinedQuery instance
and a Query instance, the CombinedQueryOperator is used between them.
CombinedQueryOperator used between the QueryBase instances
in this CombinedQuery instanceCombinedQueryOperator xgetCombinedQueryOperator()
Internal Use Only.
boolean isSetCombinedQueryOperator()
true if the CombinedQueryOperator is set, otherwise falsevoid setCombinedQueryOperator(CombinedQueryOperator.Enum combinedQueryOperator)
Sets the CombinedQueryOperator to use between the QueryBase instances
in this CombinedQuery instance.
For example, if this CombinedQuery instance contains a CombinedQuery instance
and a Query instance, the CombinedQueryOperator is used between them.
combinedQueryOperator - the CombinedQueryOperator to use between the QueryBase instances
in this CombinedQuery instancevoid xsetCombinedQueryOperator(CombinedQueryOperator combinedQueryOperator)
Internal Use Only.
void unsetCombinedQueryOperator()
CombinedQuery attribute.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||