Class TableDataFactory

    • Constructor Detail

      • TableDataFactory

        public TableDataFactory()
        Default Constructor.
      • TableDataFactory

        public TableDataFactory​(String name,
                                TableModel tableModel)
        Creates a new TableDataFactory and registers the tablemodel with the given name.
        Parameters:
        name - the name of the table.
        tableModel - the tablemodel.
    • Method Detail

      • isQueryExecutable

        public 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.
        Parameters:
        query -
        parameters -
        Returns:
      • addTable

        public void addTable​(String name,
                             TableModel tableModel)
        Registers a tablemodel with the given name. If a different tablemodel has been previously registered with the same name, this table will replace the existing one.
        Parameters:
        name - the name of the table.
        tableModel - the tablemodel that should be registered.
      • removeTable

        public void removeTable​(String name)
        Removes the table that has been registered by the given name.
        Parameters:
        name - the name of the table to be removed.
      • queryData

        public 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.

        The dataset may change between two calls, do not assume anything!

        Parameters:
        query - the name of the table.
        parameters - are ignored for this factory.
        Returns:
        the report data or null.
        Throws:
        ReportDataFactoryException - if an error occured while performing the query.
      • close

        public void close()
        Closes the data factory. Actually, this one does nothing at all.
      • derive

        public 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.
        Specified by:
        derive in interface DataFactory
        Overrides:
        derive in class AbstractDataFactory
        Returns:
        a copy of the data factory.
      • 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.