Package adams.db

Class AbstractTable

    • Field Detail

      • m_Properties

        protected static Properties m_Properties
        the properties file.
      • m_TableName

        protected String m_TableName
        name of the table.
    • Constructor Detail

      • AbstractTable

        public AbstractTable​(AbstractDatabaseConnection dbcon,
                             String tableName)
        Initializes the table.
        Parameters:
        dbcon - the database context this table is used in
        tableName - the name of the table
    • Method Detail

      • isEnabled

        public static boolean isEnabled​(Class cls)
        Returns whether the specified table is enabled and should get created if non-existent.
        Parameters:
        cls - the table class to check
        Returns:
        true if table is to be available
      • tableExists

        public boolean tableExists()
        Checks that a given table exists.
        Returns:
        true if the table exists.
      • columnExists

        public boolean columnExists​(String column)
        Checks that a given column exists.
        Parameters:
        column - the column to look for
        Returns:
        true if the column exists.
      • init

        public abstract boolean init()
        Initialize table, e.g., creating.
        Returns:
        successful initialization
      • toString

        public String toString()
        Returns a short string representation.
        Overrides:
        toString in class SQL
        Returns:
        the string representation
      • getTables

        public static String[] getTables()
        Returns a list with classnames of tables.
        Returns:
        the table classnames
      • getProperties

        protected static Properties getProperties()
        Returns the properties. Loads them if necessary.
        Returns:
        the properties