com.businessobjects.rebean.wi
Interface Query

All Superinterfaces:
QueryNode, TreeNode

public interface Query
extends QueryNode

Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Query interface is a representation of a query.

See Also:
DataProvider

Method Summary
 void addResultObject(DataSourceObject obj)
          Adds an object to the Query.
 boolean containsUnresolvableResultsObjects()
          Returns true, when the Query contains object that no longer exist in the DataSource.
 ConditionContainer copyCondition(ConditionContainer cont)
          Makes a copy of cont and makes that this query's condition container.
 ConditionContainer createCondition(LogicalOperator op)
          Creates a ConditionContainer for this query.
 ConditionContainer getCondition()
          Gets the condition container for this Query.
 boolean getDuplicatedRows()
          Deprecated. Use SQLDataProvider.getDuplicatedRows().
 int getMaxRetrievalTime()
          Gets the maximum amount of time, in milliseconds, to wait for data to be retrieved.
 int getMaxRowsRetrieved()
          Gets the maximum number of rows retrieved from the database.
 PromptOrder getPromptOrder()
          Returns a collection with all prompts contained in this query.
 QuerySorts getQuerySorts()
          Gets a collection of the sorts used in this query.
 DataSourceObject getResultObject(int index)
          Gets an object in the query by index.
 int getResultObjectCount()
          Gets the amount of objects in the query.
 Scope getScope()
          Gets the scope of analysis.
 java.lang.String getSQL()
          Deprecated. Use SQLDataProvider.getSQLContainer() and SQLSelectStatement.getSQL().
 boolean hasCondition()
          Returns true when a condition has been set on the Query.
 boolean isStripped()
           
 void removeAllResultObjects()
          Removes any objects from the query.
 void removeCondition()
          Removes any condition container in the Query.
 void removeResultObject(DataSourceObject obj)
          Removes an object from the query.
 boolean resetContexts()
          Verifies if contexts will be prompted upon a refresh or when the query is run.
 void resetContexts(boolean b)
          Set if contexts will be prompted upon a refresh or when a query is run.
 void setDuplicatedRows(boolean allow)
          Deprecated. Use SQLDataProvider.setDuplicatedRows(boolean allow).
 void setMaxRetrievalTime(int time)
          Changes the maximum amount of time, in milliseconds, to wait for data to be retrieved.
 void setMaxRowsRetrieved(int rows)
          Changes the maximum number of rows that can be retrieved from the database.
 void setStripped(boolean b)
           
 
Methods inherited from interface com.businessobjects.rebean.wi.QueryNode
getID, getQueryNodeAt, remove, removeAllChildren
 
Methods inherited from interface com.businessobjects.rebean.wi.TreeNode
getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Method Detail

getScope

Scope getScope()
Gets the scope of analysis.

Returns:
A Scope instance allowing the user to view or modify the scope of analysis.

getMaxRowsRetrieved

int getMaxRowsRetrieved()
Gets the maximum number of rows retrieved from the database. The returned value could be defined in universe or customer value Query.setMaxRowsRetrieved(int).

Returns:
The maximum number of rows, or -1 when there is no maximum defined.

setMaxRowsRetrieved

void setMaxRowsRetrieved(int rows)
Changes the maximum number of rows that can be retrieved from the database.

Parameters:
rows - The maximum number of rows. A negative value will remove any maximum row limit.

getMaxRetrievalTime

int getMaxRetrievalTime()
Gets the maximum amount of time, in milliseconds, to wait for data to be retrieved.

Returns:
The maximum amount of time, or -1 when there is no maximum defined. Note The default is -1, or no maximum wait time.

setMaxRetrievalTime

void setMaxRetrievalTime(int time)
Changes the maximum amount of time, in milliseconds, to wait for data to be retrieved.

Parameters:
time - The maximum amount of time. A negative value will remove any maximum time limit.

getDuplicatedRows

@Deprecated
boolean getDuplicatedRows()
Deprecated. Use SQLDataProvider.getDuplicatedRows().

Returns true when identical rows will be retrieved at each occurence. Gets information about whether two identical rows should be retrieved or not.

Returns:
Returns true when identical rows will be retrieved as often as they appear in the data, or false when identical rows will be retrieved only once.

setDuplicatedRows

@Deprecated
void setDuplicatedRows(boolean allow)
Deprecated. Use SQLDataProvider.setDuplicatedRows(boolean allow).

Changes the behavior for retrieving identical rows.

Parameters:
allow - Set to true for identical rows to be retrieved as often as they appear, set to false for identical rows to be retrieved once only.

getSQL

@Deprecated
java.lang.String getSQL()
Deprecated. Use SQLDataProvider.getSQLContainer() and SQLSelectStatement.getSQL().

Gets the SQL statement that is used on the database for this query. Use SQLDataProvider.getSQLContainer() to return the SQL part of a Query.

Returns:
The SQL statement.

addResultObject

void addResultObject(DataSourceObject obj)
Adds an object to the Query. After a call to DataProvider.runQuery(), this object will appear in the ReportDictionary so that it can be used in a report.

If obj already exists in the query, the method call is ignored; the object will not be added twice.

When obj is a class or a hierarchy, all objects and classes or hierarchies in that class or hierarchy will recursively be added. This means that when a class A contains a class B and obj is A, all objects in class B will be added as well. Any objects that already were in the query will not be added again. Note that any detail objects will not be added this way; they have to be added manually.

Parameters:
obj - The DataSourceObject to add.
Throws:
java.lang.NullPointerException - If obj is null.
java.lang.IllegalArgumentException - If obj is a predefined condition (predefined conditions can only be added using ConditionContainer.createConditionObject(DataSourceObject)).
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.

getResultObject

DataSourceObject getResultObject(int index)
Gets an object in the query by index.

Parameters:
index - The index of the object (0 based).
Returns:
The DataSourceObject at index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If index is invalid.

removeResultObject

void removeResultObject(DataSourceObject obj)
Removes an object from the query.

Parameters:
obj - The DataSourceObject to remove. When obj is not in the query or when it is null, no error is generated.
Throws:
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.

removeAllResultObjects

void removeAllResultObjects()
Removes any objects from the query.

Throws:
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.

getResultObjectCount

int getResultObjectCount()
Gets the amount of objects in the query.

Returns:
The amount of objects.

hasCondition

boolean hasCondition()
Returns true when a condition has been set on the Query.

Returns:
Returns true when at least one condition has been set.

createCondition

ConditionContainer createCondition(LogicalOperator op)
Creates a ConditionContainer for this query. This method is the starting point for creating conditions. If the Query already has a condition container, it will be replaced with the new one.

Parameters:
op - An operator to use when more than one conditions are held in the ConditionContainer.
Returns:
The ConditionContainer created.
Throws:
java.lang.NullPointerException - When op is null.
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.

getCondition

ConditionContainer getCondition()
Gets the condition container for this Query.

Returns:
The ConditionContainer, or null when there is no condition container for this Query.

copyCondition

ConditionContainer copyCondition(ConditionContainer cont)
Makes a copy of cont and makes that this query's condition container. Any existing container will be replaced by the copy of cont.

Parameters:
cont - The container to use for this query.
Returns:
The new condition container (the copy of cont).
Throws:
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.

removeCondition

void removeCondition()
Removes any condition container in the Query.

Throws:
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.

resetContexts

boolean resetContexts()
Verifies if contexts will be prompted upon a refresh or when the query is run.

Returns:
Returns true when contexts will be reset upon a refresh.
Since:
6.5
See Also:
DocumentInstance.refresh(), DataProvider.runQuery()

resetContexts

void resetContexts(boolean b)
Set if contexts will be prompted upon a refresh or when a query is run.

Parameters:
b - When true, contexts will be reset upon a refresh.
Since:
6.5
See Also:
DocumentInstance.refresh(), DataProvider.runQuery()

getPromptOrder

PromptOrder getPromptOrder()
Returns a collection with all prompts contained in this query. The prompts are returned in the order that they will be presented to users upon a refresh.

Returns:
The prompts properly ordered.
Since:
6.5.0

getQuerySorts

QuerySorts getQuerySorts()
Gets a collection of the sorts used in this query.

Returns:
a collection of the sorts used in this query.
Since:
11.7

isStripped

boolean isStripped()
Returns:
boolean
Since:
12.2

setStripped

void setStripped(boolean b)
Parameters:
b -
Since:
12.2

containsUnresolvableResultsObjects

boolean containsUnresolvableResultsObjects()
Returns true, when the Query contains object that no longer exist in the DataSource.

Returns:
true, if the Query contains unresolvable objects.
Since:
12.2