|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Query
Provides access to a single query consisting of query result, query condition,
and query scope objects from the Universe (data source). A QueryService query request containing a QuerySpecification has QueryBase instance, that can be either a Query or a CombinedQuery instance.
In turn, a CombinedQuery instance contain one or more QueryBase
instances. As a result, you can construct a number of Query instances and group them together
logically using the CombinedQuery interface. Finally, you can place a CombinedQuery
instance in a QuerySpecification and process the query using the QueryService service.
You can also construct a Query instance, place it in a QuerySpecification
and process the query using the QueryService service.
A query has four components:
Detail,
Dimension, and Measure.
These objects represent the data fields you want the query results to contain (for example, a product name, price, and quantity sold).PreConditionObject
from a Universe or a custom condition created using a QueryCondition.
These objects provide a filter for the query results (for example, to limit the results to a particular region, you set the value for the object representing a country or region).Hierarchy instances
in a DataSourceSpecification.
These objects specifies how drilling is performed in the document resulting from the query (for example, to drill down from country to town, you add the objects representing a country and town).QueryObjectSort. When you apply
sorting on a query object, Query Specification is updated to prepare query along with sort information.
Example: Constructing a simple query with only query result objects.
Note: This example assumes that you have obtained a DataSourceSpecification instance.
It also assumes that you have found query result objects in the Universe and have stored their keys in
these lists: dimensionKeys, detailKeys, and measureKeys.
QuerySpecification boQuerySpec = QuerySpecification.Factory.newInstance();
// Create a Query array. We are only using a single query in this example, so the array is of size 1.
Query boQuery = Query.Factory.newInstance();
// The query will contain three result objects (these objects represent the fields that are contained in the query result).
//Create an array of QueryObject objects to store the result objects. You can use Detail, Dimension, or Measure objects as result objects.
QueryObject[] boQueryResultObjects = new QueryObject[3];
boQueryResultObjects[0] = QueryObject.Factory.newInstance();
boQueryResultObjects[1] = QueryObject.Factory.newInstance();
boQueryResultObjects[2] = QueryObject.Factory.newInstance();
boQueryResultObjects[0].setKey((String)detailKeys.get(1));
boQueryResultObjects[1].setKey((String)dimensionKeys.get(0));
boQueryResultObjects[2].setKey((String)measureKeys.get(0));
boQuery.setQueryResultArray(boQueryResultObjects);
// Add the query to the QuerySpecification
boQuerySpec.setQueryBase(boQuery);
QuerySpecification,
QueryBase,
CombinedQuery,
QueryCondition,
QueryObject,
Hierarchy| Nested Class Summary | |
|---|---|
static class |
Query.Factory
A class with methods for creating instances of the Query type. |
| Field Summary | |
|---|---|
static org.apache.xmlbeans.SchemaType |
type
Internal Use Only. |
| Method Summary | |
|---|---|
QueryCondition |
addNewQueryCondition()
Appends and returns a new empty "QueryCondition" element |
QueryObjectSort |
addNewQueryObjectSort()
Appends and returns a new empty value (as xml) as the last "QueryObjectSort" element |
QueryObject |
addNewQueryResult()
Appends and returns a new empty value (as xml) as the last "QueryResult" element. |
QueryObject |
addNewQueryScope()
Appends and returns a new empty value (as xml) as the last "QueryScope" element |
QueryCondition |
getQueryCondition()
Gets the query condition object for this Query instance. |
QueryObjectSort[] |
getQueryObjectSortArray()
Gets the array of query sort objects for this Query instance. |
QueryObjectSort |
getQueryObjectSortArray(int i)
Gets the query sort object to array location i. |
QueryObject[] |
getQueryResultArray()
Gets an array of query result objects for this Query instance. |
QueryObject |
getQueryResultArray(int i)
Gets the query result object stored at array location . |
QueryObject[] |
getQueryScopeArray()
Gets the array of query scope objects for this Query instance. |
QueryObject |
getQueryScopeArray(int i)
Gets the query scope object stored at array location i. |
QueryScopeLevel.Enum |
getQueryScopeLevel()
Gets the scope level for the query as a QueryScopeLevel object. |
QueryObjectSort |
insertNewQueryObjectSort(int i)
Inserts and returns a new empty value (as xml) of the "QueryObjectSort" element at the specified index position. |
QueryObject |
insertNewQueryResult(int i)
Inserts and returns a new empty value (as xml) of the "QueryResult" element at the specified index position. |
QueryObject |
insertNewQueryScope(int i)
Inserts and returns a new empty value (as xml) of the "QueryScope" element at the specified index position. |
boolean |
isSetQueryCondition()
Checks if the "QueryCondition" element has been set. |
boolean |
isSetQueryScopeLevel()
Checks if the "QueryScopeLevel" element has been set. |
void |
removeQueryObjectSort(int i)
Removes the "QueryObjectSort" element at the specified index position. |
void |
removeQueryResult(int i)
Removes the "QueryResult" element at the specified index position. |
void |
removeQueryScope(int i)
Removes the "QueryScope" element at the specified index position. |
void |
setQueryCondition(QueryCondition queryCondition)
Sets the query condition object for this Query instance. |
void |
setQueryObjectSortArray(int i,
QueryObjectSort queryObjectSort)
Sets the query sort object to array location i. |
void |
setQueryObjectSortArray(QueryObjectSort[] queryObjectSortArray)
Sets the array of query sort objects for this Query instance. |
void |
setQueryResultArray(int i,
QueryObject queryResult)
Sets the query result object to array location i. |
void |
setQueryResultArray(QueryObject[] queryResultArray)
Sets an array of query result objects for this Query instance. |
void |
setQueryScopeArray(int i,
QueryObject queryScope)
Sets the query scope object to array location i. |
void |
setQueryScopeArray(QueryObject[] queryScopeArray)
Sets the array of query scope objects for this Query instance. |
void |
setQueryScopeLevel(QueryScopeLevel.Enum queryScopeLevel)
Sets the scope level for the query as a QueryScopeLevel object. |
int |
sizeOfQueryObjectSortArray()
Returns the size of the QueryObjectSortArray. |
int |
sizeOfQueryResultArray()
Returns the size of the QueryResult array. |
int |
sizeOfQueryScopeArray()
Returns the size of the QueryScope array |
void |
unsetQueryCondition()
Deletes or unsets the "QueryCondition" element |
void |
unsetQueryScopeLevel()
Deletes or unsets the "QueryScopeLevel" element. |
QueryScopeLevel |
xgetQueryScopeLevel()
Internal Use Only. |
void |
xsetQueryScopeLevel(QueryScopeLevel queryScopeLevel)
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
Internal Use Only.
| Method Detail |
|---|
QueryObject[] getQueryResultArray()
Gets an array of query result objects for this Query instance. The query
result object array is an array of QueryObject instances whose keys have
been set to the keys of query result objects (Dimension, Detail
or Measure instances) found
in the Universe DataSourceSpecification.
QueryQueryObject getQueryResultArray(int i)
Gets the query result object stored at array location .i.
i - The index of the query result object to retrieve.
QueryObject.int sizeOfQueryResultArray()
void setQueryResultArray(QueryObject[] queryResultArray)
Sets an array of query result objects for this Query instance. The query
result object array is an array of QueryObject instances whose keys have
been set to the keys of query result objects (Dimension, Detail,
or Measure instances) found
in the Universe DataSourceSpecification.
queryResult - the array of query result objects for this Query
void setQueryResultArray(int i,
QueryObject queryResult)
Sets the query result object to array location i.
i - the index in the array at which to store the query result object.value - a query result object as a QueryObject.QueryObject insertNewQueryResult(int i)
i - the index of the QueryResult element.
QueryObject addNewQueryResult()
void removeQueryResult(int i)
i - The index of the QueryResult element.QueryObject[] getQueryScopeArray()
Gets the array of query scope objects for this Query instance. The query
scope object array is an array of QueryObject instances whose keys have
been set to the keys of query scope objects found
in the Hierarchy instances in the Universe DataSourceSpecification.
Query instanceQueryObject getQueryScopeArray(int i)
Gets the query scope object stored at array location i.
i - The index of the query scope object to retrieve.
QueryObject.int sizeOfQueryScopeArray()
void setQueryScopeArray(QueryObject[] queryScopeArray)
Sets the array of query scope objects for this Query instance. The query
scope object array is an array of QueryObject instances whose keys have
been set to the keys of query scope objects found
in the Hierarchy instances in the Universe DataSourceSpecification.
queryScope - the array of query scope objects for this Query instance
void setQueryScopeArray(int i,
QueryObject queryScope)
Sets the query scope object to array location i.
i - The index in the array at which to store the query scope object.value - A query scope object as a QueryObject.QueryObject insertNewQueryScope(int i)
i - The index of the QueryScope element
QueryObject addNewQueryScope()
void removeQueryScope(int i)
i - the index of the QueryScope elementQueryScopeLevel.Enum getQueryScopeLevel()
Gets the scope level for the query as a QueryScopeLevel object.
QueryScopeLevel objectQueryScopeLevel xgetQueryScopeLevel()
Internal Use Only.
boolean isSetQueryScopeLevel()
true if the QueryScopeLevel element is set, otherwise falsevoid setQueryScopeLevel(QueryScopeLevel.Enum queryScopeLevel)
Sets the scope level for the query as a QueryScopeLevel object.
queryScopeLevel - the scope level for the query as a QueryScopeLevel objectvoid xsetQueryScopeLevel(QueryScopeLevel queryScopeLevel)
Internal Use Only.
void unsetQueryScopeLevel()
QueryObjectSort[] getQueryObjectSortArray()
Gets the array of query sort objects for this Query instance. The query
sort object array is an array of QueryObjectSort instances, which is inherited from
QueryQueryObjectSort getQueryObjectSortArray(int i)
Gets the query sort object to array location i.
i - the index in the array at which to store the query sort objectvalue - a query sort object as a QueryObjectSortint sizeOfQueryObjectSortArray()
void setQueryObjectSortArray(QueryObjectSort[] queryObjectSortArray)
Sets the array of query sort objects for this Query instance. The query
sort object array is an array of QueryObjectSort instances, which is inherited from
QueryObjectSort - the array of query sort objects for this Query
void setQueryObjectSortArray(int i,
QueryObjectSort queryObjectSort)
Sets the query sort object to array location i.
i - the index in the array at which to store the query sort objectvalue - a query sort object as a QueryObjectSortQueryObjectSort insertNewQueryObjectSort(int i)
i - the index of the QueryObjectSort element
QueryObjectSort addNewQueryObjectSort()
void removeQueryObjectSort(int i)
i - the index of the QueryObjectSort elementQueryCondition getQueryCondition()
Gets the query condition object for this Query instance. The query
condition object array is an array of QueryCondition instances.
Query instanceboolean isSetQueryCondition()
true if the QueryCondition element is set, otherwise falsevoid setQueryCondition(QueryCondition queryCondition)
Sets the query condition object for this Query instance. The query
condition object array is an array of QueryCondition instances.
queryCondition - the array of query condition objects for this Query instanceQueryCondition addNewQueryCondition()
void unsetQueryCondition()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||