Class ModelMetaData


  • public class ModelMetaData
    extends Object
    The whole metadata for the connected database.
    Author:
    harald
    • Constructor Detail

      • ModelMetaData

        public ModelMetaData​(Backend backend,
                             DatabaseMetaData[] metaData,
                             String[] schemas)
        Creates a database meta instance.
        Parameters:
        backend - the backend
        metaData - the connections meta data
        schemas - optional schemas, null if no schema check
    • Method Detail

      • getProperties

        public Properties getProperties()
        Gets the migration properties.
        Used to remember settings of the migration process.
        Returns:
        the properties
      • getTableInDatabase

        public List<DatabaseMetaDataTableHeader> getTableInDatabase​(String tableName)
                                                             throws SQLException
        Gets the header infos for given tablename.
        May return more than one entry if the same tablename is used in more than one schema.
        Parameters:
        tableName - the tablename
        Returns:
        the non-empty list of header infos, null if no such table in database
        Throws:
        SQLException - if cannot retrieve meta data from database
      • addTableMetaData

        public boolean addTableMetaData​(TableMetaData tableMetaData)
        Adds a table to this model.
        If schemas are set, only tables belonging to one of given schemas will be appended.
        Parameters:
        tableMetaData - the table
        Returns:
        true if added, false if wrong schema
      • getBackend

        public Backend getBackend()
        Gets the backend.
        Returns:
        the backend
      • getSchemas

        public String[] getSchemas()
        Gets the valid schemas.
        Returns:
        the optional schemas, null if no schema check
      • getMetaData

        public DatabaseMetaData[] getMetaData()
        Gets the JDBC-connection's meta data.
        May be more than one if different schemas and schema-option was given in BackendInfo.
        Returns:
        the meta data