Class MsTable

All Implemented Interfaces:
IHashable, IOptionContainer, IRelation, ISearchPath, ISimpleOptionContainer, IStatement, IStatementContainer

public final class MsTable extends AbstractTable implements ISimpleOptionContainer
Represents a Microsoft SQL table with support for memory-optimized tables, temporal tables, filestream data, and other Microsoft SQL specific features.
  • Constructor Details

    • MsTable

      public MsTable(String name)
      Creates a new Microsoft SQL table with the specified name.
      Parameters:
      name - the table name
  • Method Details

    • getCreationSQL

      public void getCreationSQL(SQLScript script)
      Description copied from class: PgStatement
      Generates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.
      Specified by:
      getCreationSQL in class PgStatement
      Parameters:
      script - the SQL script to append creation statements to
    • appendAlterSQL

      public ObjectState appendAlterSQL(PgStatement newCondition, SQLScript script)
      Description copied from class: PgStatement
      Fill script with object changes and return change type
      Specified by:
      appendAlterSQL in class PgStatement
      Parameters:
      newCondition - new object state
      script - script to collect changes
      Returns:
      object change type
    • getPkeys

      public List<AbstractConstraint> getPkeys()
      Gets the list of primary key constraints for memory-optimized tables.
      Returns:
      unmodifiable list of primary key constraints
    • addConstraint

      public void addConstraint(AbstractConstraint constraint)
      Description copied from class: PgStatementContainer
      Adds a constraint to this container.
      Overrides:
      addConstraint in class AbstractTable
      Parameters:
      constraint - the constraint to add
    • compareTableOptions

      public void compareTableOptions(MsTable newTable, SQLScript script)
      Compares table options between this table and the new table, generating appropriate SQL scripts for change tracking and system versioning differences.
      Parameters:
      newTable - the new table to compare against
      script - the script to append SQL statements to
    • getAlterTable

      public String getAlterTable(boolean only)
      Description copied from class: AbstractTable
      Generates beginning of alter table statement.
      Specified by:
      getAlterTable in class AbstractTable
      Parameters:
      only - if true, append 'ONLY' to statement
      Returns:
      alter table statement beginning in String format
    • getDropSQL

      public void getDropSQL(SQLScript script, boolean generateExists)
      Description copied from class: PgStatement
      Generates DROP SQL for this statement.
      Overrides:
      getDropSQL in class PgStatement
      Parameters:
      script - the SQL script to append the DROP statement to
      generateExists - whether to include "IF EXISTS" in the DROP statement
    • setFileStream

      public void setFileStream(String fileStream)
    • setTextImage

      public void setTextImage(String textImage)
    • setAnsiNulls

      public void setAnsiNulls(boolean ansiNulls)
    • isTracked

      public boolean isTracked()
      Checks if change tracking is enabled for this table.
      Returns:
      true if change tracking is enabled
    • setTracked

      public void setTracked(Boolean isTracked)
    • getTablespace

      public String getTablespace()
    • setTablespace

      public void setTablespace(String tablespace)
    • setPeriodStartCol

      public void setPeriodStartCol(AbstractColumn periodStartCol)
    • setPeriodEndCol

      public void setPeriodEndCol(AbstractColumn periodEndCol)
    • isMemoryOptimized

      public boolean isMemoryOptimized()
      Checks if this table is memory-optimized.
      Returns:
      true if the table is memory-optimized
    • setSysVersioning

      public void setSysVersioning(String sysVersioning)
    • compare

      public boolean compare(PgStatement obj)
      Description copied from class: PgStatement
      This method does not account for nested child PgStatements. Shallow version of PgStatement.equals(Object)
      Overrides:
      compare in class AbstractTable
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Overrides:
      computeHash in class AbstractTable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • getDbType

      public DatabaseType getDbType()
      Overrides:
      getDbType in class PgStatement
    • addChild

      public void addChild(IStatement st)
      Description copied from interface: IStatementContainer
      Adds a child statement to this container.
      Specified by:
      addChild in interface IStatementContainer
      Overrides:
      addChild in class PgStatementContainer
      Parameters:
      st - the child statement to add
    • getChild

      public PgStatement getChild(String name, DbObjType type)
      Description copied from interface: IStatementContainer
      Gets a child statement by name and type.
      Specified by:
      getChild in interface IStatementContainer
      Overrides:
      getChild in class PgStatementContainer
      Parameters:
      name - the name of the child to find
      type - the type of the child to find
      Returns:
      the child statement, or null if not found
    • compareChildren

      public boolean compareChildren(PgStatement obj)
      Description copied from class: PgStatement
      Deep part of PgStatement.equals(Object). Compares all object's child PgStatements for equality.
      Overrides:
      compareChildren in class AbstractTable
    • computeChildrenHash

      public void computeChildrenHash(Hasher hasher)
      Overrides:
      computeChildrenHash in class AbstractTable