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.
        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.
        query -
        parameters -
      • 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.
        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.
        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!

        query - the name of the table.
        parameters - are ignored for this factory.
        the report data or null.
        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
        derive in class AbstractDataFactory
        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.
        the known query names.