Interface DataFactory

    • Field Detail


        static final String QUERY_LIMIT
        An internal query parameter that holds the maximum number of rows a query should return.
        See Also:
        Constant Field Values

        static final String QUERY_TIMEOUT
        An internal query parameter that holds the query timeout value. This is passed to the data-source. The handling of this parameter is implementation dependent.
        See Also:
        Constant Field Values
    • Method Detail

      • queryData

        TableModel queryData​(String query,
                             DataRow parameters)
                      throws ReportDataFactoryException
        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.

        query - the query string, never null.
        parameters - the parameters for the query, never null.
        the result of the query as table model.
        ReportDataFactoryException - if an error occured while performing the query.
      • derive

        DataFactory derive()
        Returns a copy of the data factory that is not affected by its anchestor and holds no connection to the anchestor anymore. A data-factory will be derived at the beginning of the report processing.
        a copy of the data factory.
      • close

        void close()
        Closes the data factory and frees all resources held by this instance.
      • isQueryExecutable

        boolean isQueryExecutable​(String query,
                                  DataRow parameters)
        Checks whether the query would be executable by this datafactory. This performs a rough check, not a full query.
        query - the query, never null.
        parameters - the parameters, never null.
        true, if the query would be executable, false if the query is not recognized.
      • getQueryNames

        String[] getQueryNames()
        Returns all known query-names. A data-factory may accept more than the query-names returned here.
        the known query names.
      • cancelRunningQuery

        void cancelRunningQuery()
        Attempts to cancel the query process that is generating the data for this data factory. If it is not possible to cancel the query, this call should be ignored.
      • initialize

        void initialize​(DataFactoryContext dataFactoryContext)
                 throws ReportDataFactoryException
        Initializes the data factory and provides new context information. Initialize is always called before the datafactory has been opened by calling DataFactory#open.
        dataFactoryContext - the current data-factory context, holding the configuration, resource-manager, context-key and resource-bundle-factory.
      • getMetaData

        DataFactoryMetaData getMetaData()
        the metadata object for this dataFactory