org.eclipse.birt.data.engine.api.querydefn
Class QueryDefnDelegator

java.lang.Object
  extended by org.eclipse.birt.data.engine.api.querydefn.BaseTransform
      extended by org.eclipse.birt.data.engine.api.querydefn.BaseQueryDefinition
          extended by org.eclipse.birt.data.engine.api.querydefn.QueryDefinition
              extended by org.eclipse.birt.data.engine.api.querydefn.QueryDefnDelegator
All Implemented Interfaces:
IBaseQueryDefinition, IBaseTransform, IDataQueryDefinition, INamedObject, IQueryDefinition
Direct Known Subclasses:
NoRecalculateIVQuery

public class QueryDefnDelegator
extends QueryDefinition


Field Summary
protected  IBaseQueryDefinition baseQuery
           
protected  java.lang.String dataSetName
           
protected  java.lang.String queryResultsId
           
 
Fields inherited from class org.eclipse.birt.data.engine.api.querydefn.QueryDefinition
bindings, projectedColumns
 
Fields inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseQueryDefinition
distinctValue, groups, hasDetail, maxRowCount, parentQuery, startingRow
 
Fields inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseTransform
AFTER_LAST_ROW, afterExpressions, BEFORE_FIRST_ROW, beforeExpressions, filters, ON_EACH_ROW, rowExpressions, sorts, subqueries
 
Constructor Summary
QueryDefnDelegator(IBaseQueryDefinition query)
           
QueryDefnDelegator(IBaseQueryDefinition query, java.lang.String queryResultsId, java.lang.String dataSetName)
           
 
Method Summary
 void addBinding(IBinding binding)
          Add a column binding instance to query definition.
 boolean cacheQueryResults()
          Indicates if the query need cache the result rows .
 IQueryDefinition getBaseQuery()
           
 java.util.Map getBindings()
          Get all column binding instance from query definition.
 java.lang.String[] getColumnProjection()
          Provides a column projection hint to the data engine.
 java.lang.String getDataSetName()
          Gets the name of the data set used by this query
 boolean getDistinctValue()
          If the flag is true this query will return the rows with distinct or unique column values.
 java.util.List getFilters()
          Returns the filters defined in this transform, as an ordered list of IFilterDefintion objects.
 java.util.List getGroups()
          Returns the group definitions as an ordered collection of GroupDefinition objects.
 java.util.Collection getInputParamBindings()
          Returns the set of input parameter bindings as an unordered collection of InputParameterBinding objects.
 int getMaxRows()
          Gets the maximum number of detail rows that can be retrieved by this report query
 java.lang.String getName()
          get the name of current object.
 IBaseQueryDefinition getParentQuery()
          Returns the parent query.
 IQueryExecutionHints getQueryExecutionHints()
          Return the Query Execution Hints information.
 java.lang.String getQueryResultsID()
          When this value is not null, the data set name will not be used, since it indicates query is running on the data of report document or local caching of QueryResults.
 java.util.Map getResultSetExpressions()
          Gets the expressions that needs to be available at the group/list, as an Map of bound colum name to IBaseExpression objects.
 java.util.List getSorts()
          Returns the sort criteria as an ordered list of SortDefinition objects.
 IBaseQueryDefinition getSourceQuery()
          Return the source query of current query.
 int getStartingRow()
          Gets the starting row that will be retrieved by this query
 java.util.Collection getSubqueries()
          Returns an unordered collection of subqueries that are alternative views of the result set for this transform.
 boolean isSummaryQuery()
          Return whether this query definition is a summary query definition.
 boolean needAutoBinding()
          When user knows which columns are in data set and user likes to get the column value without explicitly binding a name to a data set row expression, this flag can be set as true to indicate it.
 void setMaxRows(int maxRows)
          Sets the maximum number of detail rows that can be retrieved by this report query
 void setName(java.lang.String name)
          set the name of current object.
 void setQueryResultsID(java.lang.String queryResultsID)
           
 void setSourceQuery(IBaseQueryDefinition object)
           
 boolean usesDetails()
          Indicates if the report will use the detail rows.
 
Methods inherited from class org.eclipse.birt.data.engine.api.querydefn.QueryDefinition
addInputParamBinding, setAutoBinding, setColumnProjection, setDataSetName, setIsSummaryQuery
 
Methods inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseQueryDefinition
addGroup, addResultSetExpression, isTempQuery, setAsTempQuery, setCacheQueryResults, setDistinctValue, setQueryExecutionHints, setStartingRow, setUsesDetails
 
Methods inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseTransform
addFilter, addSort, addSubquery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseQuery

protected IBaseQueryDefinition baseQuery

queryResultsId

protected java.lang.String queryResultsId

dataSetName

protected java.lang.String dataSetName
Constructor Detail

QueryDefnDelegator

public QueryDefnDelegator(IBaseQueryDefinition query)

QueryDefnDelegator

public QueryDefnDelegator(IBaseQueryDefinition query,
                          java.lang.String queryResultsId,
                          java.lang.String dataSetName)
Method Detail

usesDetails

public boolean usesDetails()
Description copied from class: BaseQueryDefinition
Indicates if the report will use the detail rows. Allows the data transform engine to optimize the query if the details are not used.

Specified by:
usesDetails in interface IBaseQueryDefinition
Overrides:
usesDetails in class BaseQueryDefinition
Returns:
true if the detail rows are used, false if not used

cacheQueryResults

public boolean cacheQueryResults()
Description copied from interface: IBaseQueryDefinition
Indicates if the query need cache the result rows . The query result can be reload form the cache if the cache is used.

Specified by:
cacheQueryResults in interface IBaseQueryDefinition
Overrides:
cacheQueryResults in class BaseQueryDefinition
Returns:
true if cache is needed.

getParentQuery

public IBaseQueryDefinition getParentQuery()
Description copied from class: BaseQueryDefinition
Returns the parent query. The parent query is the outer query which encloses this query

Specified by:
getParentQuery in interface IBaseQueryDefinition
Overrides:
getParentQuery in class BaseQueryDefinition

getMaxRows

public int getMaxRows()
Description copied from class: BaseQueryDefinition
Gets the maximum number of detail rows that can be retrieved by this report query

Specified by:
getMaxRows in interface IBaseQueryDefinition
Overrides:
getMaxRows in class BaseQueryDefinition
Returns:
Maximum number of rows. If 0, there is no limit on how many rows this query can retrieve.

setMaxRows

public void setMaxRows(int maxRows)
Description copied from class: BaseQueryDefinition
Sets the maximum number of detail rows that can be retrieved by this report query

Specified by:
setMaxRows in interface IBaseQueryDefinition
Overrides:
setMaxRows in class BaseQueryDefinition

getResultSetExpressions

public java.util.Map getResultSetExpressions()
Description copied from interface: IBaseQueryDefinition
Gets the expressions that needs to be available at the group/list, as an Map of bound colum name to IBaseExpression objects.

Specified by:
getResultSetExpressions in interface IBaseQueryDefinition
Overrides:
getResultSetExpressions in class BaseQueryDefinition
Returns:

addBinding

public void addBinding(IBinding binding)
                throws org.eclipse.birt.data.engine.core.DataException
Description copied from interface: IBaseQueryDefinition
Add a column binding instance to query definition.

Specified by:
addBinding in interface IBaseQueryDefinition
Overrides:
addBinding in class BaseQueryDefinition
Throws:
org.eclipse.birt.data.engine.core.DataException

getBindings

public java.util.Map getBindings()
Description copied from interface: IBaseQueryDefinition
Get all column binding instance from query definition.

Specified by:
getBindings in interface IBaseQueryDefinition
Overrides:
getBindings in class BaseQueryDefinition
Returns:

getQueryExecutionHints

public IQueryExecutionHints getQueryExecutionHints()
Description copied from interface: IBaseQueryDefinition
Return the Query Execution Hints information. The Query Execution Hints information defines hints info for Data engine to execution the query.

Specified by:
getQueryExecutionHints in interface IBaseQueryDefinition
Overrides:
getQueryExecutionHints in class BaseQueryDefinition
Returns:

getStartingRow

public int getStartingRow()
Description copied from interface: IBaseQueryDefinition
Gets the starting row that will be retrieved by this query

Specified by:
getStartingRow in interface IBaseQueryDefinition
Overrides:
getStartingRow in class BaseQueryDefinition
Returns:

getDistinctValue

public boolean getDistinctValue()
Description copied from interface: IBaseQueryDefinition
If the flag is true this query will return the rows with distinct or unique column values. Currently this flag is valid only for the query which use another query as data source.

Specified by:
getDistinctValue in interface IBaseQueryDefinition
Overrides:
getDistinctValue in class BaseQueryDefinition
Returns:

getFilters

public java.util.List getFilters()
Description copied from class: BaseTransform
Returns the filters defined in this transform, as an ordered list of IFilterDefintion objects.

Specified by:
getFilters in interface IBaseTransform
Overrides:
getFilters in class BaseTransform
Returns:
the filters. null if no filter is defined.

getSubqueries

public java.util.Collection getSubqueries()
Description copied from class: BaseTransform
Returns an unordered collection of subqueries that are alternative views of the result set for this transform. Objects are of type SubqueryDefinition.

Specified by:
getSubqueries in interface IBaseTransform
Overrides:
getSubqueries in class BaseTransform
Returns:
the subqueries for this transform
See Also:
ISubqueryDefinition

getSorts

public java.util.List getSorts()
Description copied from class: BaseTransform
Returns the sort criteria as an ordered list of SortDefinition objects.

Specified by:
getSorts in interface IBaseTransform
Overrides:
getSorts in class BaseTransform
Returns:
the sort criteria

setName

public void setName(java.lang.String name)
Description copied from interface: INamedObject
set the name of current object.

Specified by:
setName in interface INamedObject
Overrides:
setName in class BaseQueryDefinition

getName

public java.lang.String getName()
Description copied from interface: INamedObject
get the name of current object.

Specified by:
getName in interface INamedObject
Overrides:
getName in class BaseQueryDefinition
Returns:

getDataSetName

public java.lang.String getDataSetName()
Description copied from class: QueryDefinition
Gets the name of the data set used by this query

Specified by:
getDataSetName in interface IQueryDefinition
Overrides:
getDataSetName in class QueryDefinition

getQueryResultsID

public java.lang.String getQueryResultsID()
Description copied from interface: IQueryDefinition
When this value is not null, the data set name will not be used, since it indicates query is running on the data of report document or local caching of QueryResults.

Specified by:
getQueryResultsID in interface IQueryDefinition
Overrides:
getQueryResultsID in class QueryDefinition
Returns:
associated queryResultID in query on report document/local caching

needAutoBinding

public boolean needAutoBinding()
Description copied from interface: IQueryDefinition
When user knows which columns are in data set and user likes to get the column value without explicitly binding a name to a data set row expression, this flag can be set as true to indicate it. For example, there is one column, COUNTRY. When this flag is false, if user wants to get the value of COUNTRY, user first needs to add a binding like , and then user can get the value by the name of COUNTRY. But if this flag is set, user does not need to add the binding, and then user can get the value directly. Currently only when there is data set defined, this flag will have effect.

Specified by:
needAutoBinding in interface IQueryDefinition
Overrides:
needAutoBinding in class QueryDefinition
Returns:
true, auto binding needs to be supported. false, auto binding is not supported, this is default behavior.

getInputParamBindings

public java.util.Collection getInputParamBindings()
Description copied from class: QueryDefinition
Returns the set of input parameter bindings as an unordered collection of InputParameterBinding objects.

Specified by:
getInputParamBindings in interface IQueryDefinition
Overrides:
getInputParamBindings in class QueryDefinition
Returns:
the input parameter bindings. If no binding is defined, null is returned.

getColumnProjection

public java.lang.String[] getColumnProjection()
Description copied from interface: IQueryDefinition
Provides a column projection hint to the data engine. The caller informs the data engine that only a selected list of columns defined by the data set are used by this report query. The names of those columns (the "projected columns") are passed in as an array of string.
If a column projection is set, runtime error may occur if the report query uses columns that are not defined in the projected column list.

Specified by:
getColumnProjection in interface IQueryDefinition
Overrides:
getColumnProjection in class QueryDefinition
See Also:
IQueryDefinition.getColumnProjection()

getSourceQuery

public IBaseQueryDefinition getSourceQuery()
Description copied from interface: IQueryDefinition
Return the source query of current query. If source query is provided, the execution result of it will be treated as the "data source" of current query definition. That is, the current query will be executed against the query results, rather then "data source/data set" settings.

Specified by:
getSourceQuery in interface IQueryDefinition
Overrides:
getSourceQuery in class QueryDefinition
Returns:

isSummaryQuery

public boolean isSummaryQuery()
Description copied from interface: IQueryDefinition
Return whether this query definition is a summary query definition. A summary query definition contains only one row each group, and only allow aggregations in inner most group.

Specified by:
isSummaryQuery in interface IQueryDefinition
Overrides:
isSummaryQuery in class QueryDefinition
Returns:

getBaseQuery

public IQueryDefinition getBaseQuery()

setSourceQuery

public void setSourceQuery(IBaseQueryDefinition object)
Overrides:
setSourceQuery in class QueryDefinition

getGroups

public java.util.List getGroups()
Description copied from class: BaseQueryDefinition
Returns the group definitions as an ordered collection of GroupDefinition objects. Groups are organizations within the data that support aggregation, filtering and sorting. Reports use groups to trigger level breaks.

Specified by:
getGroups in interface IBaseQueryDefinition
Overrides:
getGroups in class BaseQueryDefinition
Returns:
the list of groups. If no group is defined, null is returned.

setQueryResultsID

public void setQueryResultsID(java.lang.String queryResultsID)
Overrides:
setQueryResultsID in class QueryDefinition


Copyright © 2008 Actuate Corp. All rights reserved.