Class AbstractNamedDataFactory<T>
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.AbstractDataFactory
-
- org.pentaho.reporting.engine.classic.core.AbstractNamedDataFactory<T>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DataFactory
,DataFactoryDesignTimeSupport
,DataFactoryMetaProvider
public abstract class AbstractNamedDataFactory<T> extends AbstractDataFactory
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pentaho.reporting.engine.classic.core.AbstractDataFactory
AbstractDataFactory.DataRowWrapper
-
-
Field Summary
-
Fields inherited from interface org.pentaho.reporting.engine.classic.core.DataFactory
QUERY_LIMIT, QUERY_SORT, QUERY_TIMEOUT
-
Fields inherited from interface org.pentaho.reporting.engine.classic.core.DataFactoryDesignTimeSupport
DESIGN_TIME
-
-
Constructor Summary
Constructors Constructor Description AbstractNamedDataFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
getQueryHash(String query, DataRow dataRow)
protected abstract Object
getQueryHashInternal(T queryObject, DataRow dataRow)
String[]
getQueryNames()
Returns all known query-names.String[]
getReferencedFields(String query, DataRow dataRow)
protected abstract String[]
getReferencedFieldsInternal(T query, DataRow dataRow)
boolean
isQueryExecutable(String query, DataRow parameters)
Checks whether the query would be executable by this datafactory.protected T
mapQuery(String query)
TableModel
queryData(String query, DataRow parameters)
Queries a datasource.protected abstract TableModel
queryDataInternal(T query, DataRow parameters)
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.AbstractDataFactory
calculateQueryLimit, calculateQueryTimeOut, cancelRunningQuery, clone, derive, getConfiguration, getContextKey, getDataFactoryContext, getDisplayConnectionName, getLocale, getMetaData, getResourceBundleFactory, getResourceManager, initialize, queryDesignTimeStructure
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.DataFactory
close
-
-
-
-
Method Detail
-
mapQuery
protected T mapQuery(String query) throws ReportDataFactoryException
- Throws:
ReportDataFactoryException
-
queryData
public final TableModel queryData(String query, DataRow parameters) throws ReportDataFactoryException
Description copied from interface:DataFactory
Queries a datasource. The string 'query' defines the name of the query. The Parameterset given here may contain more data than actually needed for the query. The parameter-dataset may change between two calls, do not assume anything, and do not hold references to the parameter-dataset or the position of the columns in the dataset.- Parameters:
query
- the query string, never null.parameters
- the parameters for the query, never null.- Returns:
- the result of the query as table model.
- Throws:
ReportDataFactoryException
- if an error occured while performing the query.
-
queryDataInternal
protected abstract TableModel queryDataInternal(T query, DataRow parameters) throws ReportDataFactoryException
- Throws:
ReportDataFactoryException
-
isQueryExecutable
public boolean isQueryExecutable(String query, DataRow parameters)
Description copied from interface:DataFactory
Checks whether the query would be executable by this datafactory. This performs a rough check, not a full query.- Parameters:
query
- the query, never null.parameters
- the parameters, never null.- Returns:
- true, if the query would be executable, false if the query is not recognized.
-
getQueryNames
public String[] getQueryNames()
Description copied from interface:DataFactory
Returns all known query-names. A data-factory may accept more than the query-names returned here.- Returns:
- the known query names.
-
getReferencedFields
public final String[] getReferencedFields(String query, DataRow dataRow) throws ReportDataFactoryException
- Specified by:
getReferencedFields
in interfaceDataFactoryMetaProvider
- Overrides:
getReferencedFields
in classAbstractDataFactory
- Throws:
ReportDataFactoryException
-
getReferencedFieldsInternal
protected abstract String[] getReferencedFieldsInternal(T query, DataRow dataRow) throws ReportDataFactoryException
- Throws:
ReportDataFactoryException
-
getQueryHash
public final Object getQueryHash(String query, DataRow dataRow) throws ReportDataFactoryException
- Specified by:
getQueryHash
in interfaceDataFactoryMetaProvider
- Overrides:
getQueryHash
in classAbstractDataFactory
- Throws:
ReportDataFactoryException
-
getQueryHashInternal
protected abstract Object getQueryHashInternal(T queryObject, DataRow dataRow) throws ReportDataFactoryException
- Throws:
ReportDataFactoryException
-
-