|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface QuerySpecification
The actual query that you want to execute is specified using the QuerySpecification interface.
This interface contains two important objects:
QueryBase object, andQueryProperty objects.
The QueryBase object can be either an instance of CombinedQuery or Query.
The CombinedQuery may contain one or more additional QueryBase objects. This structure
allows you to create a QuerySpecification made up of simple or complex query structures. The array of QueryProperty
objects specifies various property values for the query. The example below describes how to construct a simple query
using the QuerySpecification interface. Once you have constructed a QuerySpecification instance, you execute
the query by passing the QuerySpecification instance to the QueryService.createDataProvider
method.
For further examples about how to use the QuerySpecification interface,
see the Business Objects web services Developer's Guide.
Example: Constructing a simple query.
Note: This example assumes that you have obtained a DataSourceSpecification instance.
Additionally, it assumes that you have found query result objects in the Universe and have stored their keys in
lists called 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);
| Nested Class Summary | |
|---|---|
static class |
QuerySpecification.Factory
A class with methods for creating instances of the QuerySpecification type. |
| Field Summary | |
|---|---|
static org.apache.xmlbeans.SchemaType |
type
Internal Use Only. |
| Method Summary | |
|---|---|
QueryBase |
addNewQueryBase()
Appends and returns a new empty "QueryBase" element |
QueryProperty |
addNewQueryProperty()
Appends and returns a new empty value (as xml) as the last QueryProperty element |
java.lang.String |
getName()
Gets the name of this QuerySpecification instance. |
QueryBase |
getQueryBase()
Gets the QueryBase instance (which may be a CombinedQuery or a Query instance)
from this QuerySpecification instance. |
QueryProperty[] |
getQueryPropertyArray()
Gets the array of QueryProperty instances for this QuerySpecification instance. |
QueryProperty |
getQueryPropertyArray(int i)
Gets the QueryProperty instance specified by the array index i. |
SamplingMode.Enum |
getSamplingMode()
Gets the "SamplingMode" type of this QuerySpecification instance
|
int |
getSamplingSize()
Gets the number of Rows of the Sampled Data |
QueryProperty |
insertNewQueryProperty(int i)
Inserts and returns a new empty value (as xml) of the QueryProperty element at the specified index position. |
void |
removeQueryProperty(int i)
Removes the QueryProperty element at the specified index position. |
void |
setName(java.lang.String name)
Sets the name of this QuerySpecification instance. |
void |
setQueryBase(QueryBase queryBase)
Sets the QueryBase instance (which may be a CombinedQuery or a Query instance)
for this QuerySpecification instance. |
void |
setQueryPropertyArray(int i,
QueryProperty queryProperty)
Sets the QueryProperty instance specified by the parameter value to the array location
specified by the index i. |
void |
setQueryPropertyArray(QueryProperty[] queryPropertyArray)
Sets the array of QueryProperty instances for this QuerySpecification instance. |
void |
setSamplingMode(SamplingMode.Enum samplingMode)
Sets "SamplingMode" type of this QuerySpecification instance
|
void |
setSamplingSize(int samplingSize)
Sets the number of Rows of the Sampled Data |
int |
sizeOfQueryPropertyArray()
Returns the size of the QueryProperty array. |
org.apache.xmlbeans.XmlString |
xgetName()
Internal Use Only. |
SamplingMode |
xgetSamplingMode()
Internal Use Only. |
org.apache.xmlbeans.XmlInt |
xgetSamplingSize()
Internal Use Only. |
void |
xsetName(org.apache.xmlbeans.XmlString name)
Internal Use Only. |
void |
xsetSamplingMode(SamplingMode samplingMode)
Internal Use Only. |
void |
xsetSamplingSize(org.apache.xmlbeans.XmlInt samplingSize)
Internal Use Only. |
| Field Detail |
|---|
static final org.apache.xmlbeans.SchemaType type
Internal Use Only.
| Method Detail |
|---|
QueryBase getQueryBase()
Gets the QueryBase instance (which may be a CombinedQuery or a Query instance)
from this QuerySpecification instance.
QueryBase instance for this QuerySpecification instancevoid setQueryBase(QueryBase queryBase)
Sets the QueryBase instance (which may be a CombinedQuery or a Query instance)
for this QuerySpecification instance.
queryBase - the QueryBase instance to set in this QuerySpecification instanceQueryBase addNewQueryBase()
QueryProperty[] getQueryPropertyArray()
Gets the array of QueryProperty instances for this QuerySpecification instance. The QueryProperty
class specifies the name and value of a property for a query. For example, to set the maximum number of rows fetched by the query,
you would set the name of a QueryProperty instance to "MaxRowFetched" and the value to an integer representing the
maximum number of rows fetched.
QueryProperty instances, each of which represent a name and value of a query propertyQueryProperty getQueryPropertyArray(int i)
Gets the QueryProperty instance specified by the array index i. To retrieve the fifth QueryProperty
instance in the array, you would pass in 4 as the index parameter.
The QueryProperty
class specifies the name and value of a property for a query. For example, to set the maximum number of rows fetched by the query,
you would set the name of a QueryProperty instance to "MaxRowFetched" and the value to an integer representing the
maximum number of rows fetched.
i - the index of the QueryProperty instance to retrieve (using a zero-based index)
QueryProperty instanceint sizeOfQueryPropertyArray()
void setQueryPropertyArray(QueryProperty[] queryPropertyArray)
Sets the array of QueryProperty instances for this QuerySpecification instance. The QueryProperty
class specifies the name and value of a property for a query. For example, to set the maximum number of rows fetched by the query,
you would set the name of a QueryProperty instance to "MaxRowFetched" and the value to an integer representing the
maximum number of rows fetched.
queryProperty - an array of QueryProperty instances, each of which represent a name and value of a query property
void setQueryPropertyArray(int i,
QueryProperty queryProperty)
Sets the QueryProperty instance specified by the parameter value to the array location
specified by the index i. To place the QueryProperty instance in the fifth
spot in the array, you would pass in 4 as the index parameter.
The QueryProperty
class specifies the name and value of a property for a query. For example, to set the maximum number of rows fetched by the query,
you would set the name of a QueryProperty instance to "MaxRowFetched" and the value to an integer representing the
maximum number of rows fetched.
i - the index (location) in the array where to store the QueryProperty instancevalue - the QueryProperty instance to storeQueryProperty insertNewQueryProperty(int i)
i - the index of the QueryProperty element
QueryProperty addNewQueryProperty()
void removeQueryProperty(int i)
i - the index of the QueryProperty elementjava.lang.String getName()
Gets the name of this QuerySpecification instance.
String that specifies the name of this QuerySpecification instanceorg.apache.xmlbeans.XmlString xgetName()
Internal Use Only.
void setName(java.lang.String name)
Sets the name of this QuerySpecification instance.
name - a String that specifies the name of this QuerySpecification instancevoid xsetName(org.apache.xmlbeans.XmlString name)
Internal Use Only.
SamplingMode.Enum getSamplingMode()
QuerySpecification instance
SamplingMode that specifies the Sampling Mode type of this QuerySpecification instanceSamplingMode xgetSamplingMode()
Internal Use Only.
void setSamplingMode(SamplingMode.Enum samplingMode)
Sets "SamplingMode" type of this QuerySpecification instance
a - SamplingMode that specifies the Sampling Mode type of this QuerySpecification instancevoid xsetSamplingMode(SamplingMode samplingMode)
Internal Use Only.
int getSamplingSize()
org.apache.xmlbeans.XmlInt xgetSamplingSize()
Internal Use Only.
void setSamplingSize(int samplingSize)
the - number of Rows of the Sampled Data to be retrieved.void xsetSamplingSize(org.apache.xmlbeans.XmlInt samplingSize)
Internal Use Only.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||