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

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
All Implemented Interfaces:
IBaseQueryDefinition, IBaseTransform, IDataQueryDefinition, INamedObject, IQueryDefinition

public class QueryDefinition
extends BaseQueryDefinition
implements IQueryDefinition

Default implementation of the IQueryDefinition interface


Field Summary
protected  java.util.List bindings
           
protected  java.lang.String dataSetName
           
protected  java.lang.String[] 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
QueryDefinition()
          Constructs an empty query definition
QueryDefinition(BaseQueryDefinition parent)
          Constructs a query that is nested within another query.
 
Method Summary
 void addInputParamBinding(InputParameterBinding binding)
          Adds an input parameter binding to this report query.
 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
 java.util.Collection getInputParamBindings()
          Returns the set of input parameter bindings as an unordered collection of InputParameterBinding objects.
 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.
 IBaseQueryDefinition getSourceQuery()
          Return the source query of current query.
 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 setAutoBinding(boolean autoBinding)
           
 void setColumnProjection(java.lang.String[] projectedColumns)
          Provides a column projection hint to the data engine.
 void setDataSetName(java.lang.String dataSetName)
           
 void setQueryResultsID(java.lang.String queryResultsID)
           
 void setSourceQuery(IBaseQueryDefinition sourceQuery)
           
 
Methods inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseQueryDefinition
addBinding, addGroup, addResultSetExpression, cacheQueryResults, getBindings, getDistinctValue, getGroups, getMaxRows, getName, getParentQuery, getQueryExecutionHints, getResultSetExpressions, getStartingRow, setCacheQueryResults, setDistinctValue, setMaxRows, setName, setQueryExecutionHints, setStartingRow, setUsesDetails, usesDetails
 
Methods inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseTransform
addFilter, addSort, addSubquery, getFilters, getSorts, getSubqueries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.birt.data.engine.api.IBaseQueryDefinition
addBinding, cacheQueryResults, getBindings, getDistinctValue, getGroups, getMaxRows, getParentQuery, getQueryExecutionHints, getResultSetExpressions, getStartingRow, setMaxRows, usesDetails
 
Methods inherited from interface org.eclipse.birt.data.engine.api.IBaseTransform
getFilters, getSorts, getSubqueries
 
Methods inherited from interface org.eclipse.birt.data.engine.api.INamedObject
getName, setName
 

Field Detail

dataSetName

protected java.lang.String dataSetName

bindings

protected java.util.List bindings

projectedColumns

protected java.lang.String[] projectedColumns
Constructor Detail

QueryDefinition

public QueryDefinition()
Constructs an empty query definition


QueryDefinition

public QueryDefinition(BaseQueryDefinition parent)
Constructs a query that is nested within another query. The outer query (parent) can be another query, or a sub query.

Parameters:
parent - The outer query or subquery
Method Detail

getDataSetName

public java.lang.String getDataSetName()
Gets the name of the data set used by this query

Specified by:
getDataSetName in interface IQueryDefinition

setDataSetName

public void setDataSetName(java.lang.String dataSetName)
Parameters:
dataSetName - Name of data set used by this query.

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
Returns:
true, auto binding needs to be supported. false, auto binding is not supported, this is default behavior.

setAutoBinding

public void setAutoBinding(boolean autoBinding)
Parameters:
autoBinding -

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
Returns:
associated queryResultID in query on report document/local caching

setQueryResultsID

public void setQueryResultsID(java.lang.String queryResultsID)
Parameters:
queryResultID -

getInputParamBindings

public java.util.Collection getInputParamBindings()
Returns the set of input parameter bindings as an unordered collection of InputParameterBinding objects.

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

addInputParamBinding

public void addInputParamBinding(InputParameterBinding binding)
Adds an input parameter binding to this report query.

Parameters:
binding - The bindings to set.

setColumnProjection

public void setColumnProjection(java.lang.String[] projectedColumns)
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.


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
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
Returns:

setSourceQuery

public void setSourceQuery(IBaseQueryDefinition sourceQuery)
Parameters:
sourceQuery -


Copyright © 2008 Actuate Corp. All rights reserved.