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

java.lang.Object
  extended by org.eclipse.birt.data.engine.api.querydefn.BaseDataSetDesign
All Implemented Interfaces:
IBaseDataSetDesign
Direct Known Subclasses:
JointDataSetDesign, OdaDataSetDesign, ScriptDataSetDesign

public class BaseDataSetDesign
extends java.lang.Object
implements IBaseDataSetDesign

Default implementation of IBaseDataSetDesign interface.

Describes the static design of a data set to be used by the Data Engine. Each subclass defines a specific type of data set.


Constructor Summary
BaseDataSetDesign(java.lang.String name)
          Instantiates a data set with given name.
BaseDataSetDesign(java.lang.String name, java.lang.String dataSourceName)
          Instantiates a data set with given name and data source name.
 
Method Summary
 void addComputedColumn(IComputedColumn column)
          Adds a new computed column to the data set.
 void addFilter(IFilterDefinition filter)
          Adds a filter to the filter list.
 void addInputParamBinding(IInputParameterBinding binding)
          Adds an input parameter binding.
 void addParameter(IParameterDefinition param)
          Adds a parameter definition to the data set.
 void addResultSetHint(IColumnDefinition col)
          Adds a column to the result set hints definition.
 java.lang.String getAfterCloseScript()
          Returns the afterClose script to be called just after the data set is closed.
 java.lang.String getAfterOpenScript()
          Returns the afterOpen script to be called just after the data set is opened, but before fetching each row.
 java.lang.String getBeforeCloseScript()
          Returns the beforeClose script to be called just before closing the data set.
 java.lang.String getBeforeOpenScript()
          Returns the beforeOpen script to be called just before opening the data set.
 int getCacheRowCount()
          Deprecated.  
 java.util.List getComputedColumns()
          Returns a list of computed columns.
 java.lang.String getDataSourceName()
          Returns the data source (connection) name for this data set.
 IBaseDataSetEventHandler getEventHandler()
          Returns the event handler for the data set
 java.util.List getFilters()
          Returns a list of filters.
 java.util.Collection getInputParamBindings()
          Returns the set of input parameter bindings as an unordered collection of IInputParameterBinding objects.
 java.lang.String getName()
          Gets the name of the data set.
 java.lang.String getOnFetchScript()
          Returns the onFetch script to be called just after the a row is read from the data set.
 java.util.List getParameters()
          Returns the data set parameter definitions as a list of IParameterDefinition objects.
 java.util.List getResultSetHints()
          Returns the primary result set hints as a list of IColumnDefinition objects.
 int getRowFetchLimit()
          Return the max number of rows that the data set represent by this IBaseDataSetDesign intance can fetch from data source.
 boolean needDistinctValue()
          When user wants to retrieve the distinct row, this flag needs to be set as true.
 void setAfterCloseScript(java.lang.String afterCloseScript)
          Sets the afterClose script for the data set
 void setAfterOpenScript(java.lang.String afterOpenScript)
          Sets the afterOpen script for the data set
 void setBeforeCloseScript(java.lang.String beforeCloseScript)
          Sets the beforeClose script for the data set
 void setBeforeOpenScript(java.lang.String beforeOpenScript)
          Sets the beforeOpen script for the data set
 void setCacheRowCount(int cacheRowCount)
          Deprecated.  
 void setDataSource(java.lang.String dataSourceName)
          Specifies the data source (connection) name.
 void setDistinctValue(boolean distinctValue)
           
 void setEventHandler(IBaseDataSetEventHandler handler)
          Sets the event handler for this data set
 void setOnFetchScript(java.lang.String onFetchScript)
          Sets the onFetch script for the data set
 void setRowFetchLimit(int max)
          Set up the max number of rows that the data set represent by this IBaseDataSetDesign instance can fetch from data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDataSetDesign

public BaseDataSetDesign(java.lang.String name)
Instantiates a data set with given name.

Parameters:
name - Name of data set

BaseDataSetDesign

public BaseDataSetDesign(java.lang.String name,
                         java.lang.String dataSourceName)
Instantiates a data set with given name and data source name.

Parameters:
name - Name of data set
dataSourceName - Name of data source used by this data set. Can be null or empty if this data set does not specify a data source.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IBaseDataSetDesign
Gets the name of the data set.

Specified by:
getName in interface IBaseDataSetDesign
Returns:
Name of data set.
See Also:
IBaseDataSetDesign.getName()

getCacheRowCount

public int getCacheRowCount()
Deprecated. 

Description copied from interface: IBaseDataSetDesign
When cache option is true, user needs to specify how many rows will be retrieved into cache for use.

Specified by:
getCacheRowCount in interface IBaseDataSetDesign
Returns:
cache row count

setCacheRowCount

public void setCacheRowCount(int cacheRowCount)
Deprecated. 

Parameters:
cacheRowCount -

needDistinctValue

public boolean needDistinctValue()
Description copied from interface: IBaseDataSetDesign
When user wants to retrieve the distinct row, this flag needs to be set as true. The distinct row means there is no two rows which will have the same value on all columns.

Specified by:
needDistinctValue in interface IBaseDataSetDesign
Returns:
true, distinct row is required false, no distinct requirement on row

setDistinctValue

public void setDistinctValue(boolean distinctValue)
Parameters:
distinctValue -

getDataSourceName

public java.lang.String getDataSourceName()
Description copied from interface: IBaseDataSetDesign
Returns the data source (connection) name for this data set.

Specified by:
getDataSourceName in interface IBaseDataSetDesign
Returns:
Name of the data source (connection) for this data set.
See Also:
IBaseDataSetDesign.getDataSourceName()

setDataSource

public void setDataSource(java.lang.String dataSourceName)
Specifies the data source (connection) name.

Parameters:
dataSourceName - The name of the dataSource to set.

getComputedColumns

public java.util.List getComputedColumns()
Description copied from interface: IBaseDataSetDesign
Returns a list of computed columns. Contains IComputedColumn objects. Computed columns must be computed before applying filters.

Specified by:
getComputedColumns in interface IBaseDataSetDesign
Returns:
the computed columns. An empty list if none is defined.
See Also:
IBaseDataSetDesign.getComputedColumns()()

addComputedColumn

public void addComputedColumn(IComputedColumn column)
Adds a new computed column to the data set. Ignores given computed column if null.

Parameters:
column - Could be null.

getFilters

public java.util.List getFilters()
Description copied from interface: IBaseDataSetDesign
Returns a list of filters. The List contains IFilterDefinition objects. The data set should discard any row that does not satisfy all the filters.

Specified by:
getFilters in interface IBaseDataSetDesign
Returns:
the filters. An empty list if none is defined.
See Also:
IBaseDataSetDesign.getFilters()

addFilter

public void addFilter(IFilterDefinition filter)
Adds a filter to the filter list. Ignores given filter if null.

Parameters:
filter - Could be null.

getParameters

public java.util.List getParameters()
Description copied from interface: IBaseDataSetDesign
Returns the data set parameter definitions as a list of IParameterDefinition objects.

Specified by:
getParameters in interface IBaseDataSetDesign
Returns:
the parameter definitions. An empty list if none is defined.
See Also:
IBaseDataSetDesign.getParameters()

addParameter

public void addParameter(IParameterDefinition param)
Adds a parameter definition to the data set.


getResultSetHints

public java.util.List getResultSetHints()
Description copied from interface: IBaseDataSetDesign
Returns the primary result set hints as a list of IColumnDefinition objects.

Specified by:
getResultSetHints in interface IBaseDataSetDesign
Returns:
the result set hints as a list of IColumnDefinition objects. An empty list if none is defined, which normally means that the data set can provide the definition from the underlying data access provider.
See Also:
IBaseDataSetDesign.getResultSetHints()

addResultSetHint

public void addResultSetHint(IColumnDefinition col)
Adds a column to the result set hints definition.


getInputParamBindings

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

Specified by:
getInputParamBindings in interface IBaseDataSetDesign
Returns:
the input parameter bindings. An empty collection if none is defined.
See Also:
IBaseDataSetDesign.getInputParamBindings()

addInputParamBinding

public void addInputParamBinding(IInputParameterBinding binding)
Adds an input parameter binding. Ignores given binding if null.

Parameters:
binding - Could be null.

getBeforeOpenScript

public java.lang.String getBeforeOpenScript()
Description copied from interface: IBaseDataSetDesign
Returns the beforeOpen script to be called just before opening the data set.

Specified by:
getBeforeOpenScript in interface IBaseDataSetDesign
Returns:
the beforeOpen script. Null if none is defined.
See Also:
IBaseDataSetDesign.getBeforeOpenScript()

setBeforeOpenScript

public void setBeforeOpenScript(java.lang.String beforeOpenScript)
Sets the beforeOpen script for the data set


getAfterOpenScript

public java.lang.String getAfterOpenScript()
Description copied from interface: IBaseDataSetDesign
Returns the afterOpen script to be called just after the data set is opened, but before fetching each row.

Specified by:
getAfterOpenScript in interface IBaseDataSetDesign
Returns:
the afterOpen script. Null if none is defined.
See Also:
IBaseDataSetDesign.getAfterOpenScript()

setAfterOpenScript

public void setAfterOpenScript(java.lang.String afterOpenScript)
Sets the afterOpen script for the data set

Parameters:
afterOpenScript - The AfterOpen script to set.

getOnFetchScript

public java.lang.String getOnFetchScript()
Description copied from interface: IBaseDataSetDesign
Returns the onFetch script to be called just after the a row is read from the data set. Called after setting computed columns and only for rows that pass the filters. (Not called for rows that are filtered out of the data set.)

Specified by:
getOnFetchScript in interface IBaseDataSetDesign
Returns:
the onFetch script. Null if none is defined.
See Also:
IBaseDataSetDesign.getOnFetchScript()

setOnFetchScript

public void setOnFetchScript(java.lang.String onFetchScript)
Sets the onFetch script for the data set


getBeforeCloseScript

public java.lang.String getBeforeCloseScript()
Description copied from interface: IBaseDataSetDesign
Returns the beforeClose script to be called just before closing the data set.

Specified by:
getBeforeCloseScript in interface IBaseDataSetDesign
Returns:
the beforeClose script. Null if none is defined.
See Also:
IBaseDataSetDesign.getBeforeCloseScript()

setBeforeCloseScript

public void setBeforeCloseScript(java.lang.String beforeCloseScript)
Sets the beforeClose script for the data set


getAfterCloseScript

public java.lang.String getAfterCloseScript()
Description copied from interface: IBaseDataSetDesign
Returns the afterClose script to be called just after the data set is closed.

Specified by:
getAfterCloseScript in interface IBaseDataSetDesign
Returns:
the afterClose script. Null if none is defined.
See Also:
IBaseDataSetDesign.getAfterCloseScript()

setAfterCloseScript

public void setAfterCloseScript(java.lang.String afterCloseScript)
Sets the afterClose script for the data set


getEventHandler

public IBaseDataSetEventHandler getEventHandler()
Description copied from interface: IBaseDataSetDesign
Returns the event handler for the data set

Specified by:
getEventHandler in interface IBaseDataSetDesign
See Also:
IBaseDataSetDesign.getEventHandler()

setEventHandler

public void setEventHandler(IBaseDataSetEventHandler handler)
Sets the event handler for this data set


getRowFetchLimit

public int getRowFetchLimit()
Description copied from interface: IBaseDataSetDesign
Return the max number of rows that the data set represent by this IBaseDataSetDesign intance can fetch from data source.

Specified by:
getRowFetchLimit in interface IBaseDataSetDesign
Returns:

setRowFetchLimit

public void setRowFetchLimit(int max)
Description copied from interface: IBaseDataSetDesign
Set up the max number of rows that the data set represent by this IBaseDataSetDesign instance can fetch from data source. If the input number is non-positive then unlimited number of rows will be fetched.

Specified by:
setRowFetchLimit in interface IBaseDataSetDesign


Copyright © 2008 Actuate Corp. All rights reserved.