Class BasicTable

    • Method Detail

      • getColumn

        public final Column<?> getColumn​(String colName)
                                  throws ParseException
        Description copied from interface: TableElement
        Returns a column by its name or throws an exception with a message that the column is not found.
        Specified by:
        getColumn in interface TableElement
        Parameters:
        colName - column name
        Returns:
        Throws:
        ParseException - if a column with the specified name is not found in the table
      • getPrimaryKey

        public final Map<String,​Column<?>> getPrimaryKey()
        Description copied from interface: TableElement
        Returns unmodified map of primary key columns.
        Specified by:
        getPrimaryKey in interface TableElement
        Returns:
        map of column name -> column
      • setPK

        public void setPK​(String... columnNames)
                   throws ParseException
        Sets primary key on the table in a form of array of columns. It is used for dynamic metadata management.
        Parameters:
        columnNames - array of columns
        Throws:
        ParseException - in case when an empty array is passed in
      • finalizePK

        public void finalizePK()
                        throws ParseException
        Finalizes the creation of the primary key.
        Throws:
        ParseException - if the primary key is empty.
      • getForeignKeys

        public Set<ForeignKey> getForeignKeys()
        Returns a set of foreign keys for the table.
        Returns:
      • getIndices

        public Set<Index> getIndices()
        Returns a set of indices for the table.
        Returns:
      • setPkConstraintName

        public void setPkConstraintName​(String pkConstraintName)
                                 throws ParseException
        Sets the name of constraint for the primary key.
        Parameters:
        pkConstraintName - PK constraint name
        Throws:
        ParseException - incorrect name
      • isAutoUpdate

        public boolean isAutoUpdate()
        Whether autoupdate is on/off.

        false value indicates that the table was created with the option WITH NO STRUCTURE UPDATE and it won't take part in the DB autoupdate. Default is true.
        Returns:
      • setAutoUpdate

        public void setAutoUpdate​(boolean autoUpdate)
        Sets or clears the option WITH NO STRUCTURE UPDATE.
        Parameters:
        autoUpdate - true if the table is updated automatically, false - in the opposite case.
      • getColumnIndex

        public final int getColumnIndex​(String name)
        Description copied from interface: HasColumns
        Column index in the list of columns.
        Specified by:
        getColumnIndex in interface HasColumns
        Parameters:
        name - column name.
      • hasMaterializedViews

        public boolean hasMaterializedViews()
        Returns true in case there are materialized views built on top of this table.
      • getAutoincrementedColumn

        public Optional<IntegerColumn> getAutoincrementedColumn()
        Returns the integer column with default value provided by a sequence (or empty Optional if such column does not exists).
      • getImplements

        public List<String> getImplements()
        Returns interfaces that are implemented by the cursor (values of 'implements' property) for this table.
        Returns: