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.
      • m_AnsiQuotes

        protected boolean m_AnsiQuotes
        whether to use ANSI quotes around table/column names.
    • 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
      • useAnsiQuotes

        public boolean useAnsiQuotes()
        Returns whether ANSI quotes are to be used around table/column names.
        Returns:
        true if to be used
      • quoteName

        public String quoteName​(String name)
        Returns the column/table quoted if ANSI quotes are to be used.
        Parameters:
        name - the table/column name to quote (if necessary)
        Returns:
        the potentially quoted name
        See Also:
        useAnsiQuotes()
      • 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