Class MsView

All Implemented Interfaces:
IHashable, IRelation, ISearchPath, IStatement, IStatementContainer, SourceStatement

public final class MsView extends AbstractView implements SourceStatement
Represents a Microsoft SQL view with support for schema binding, ANSI_NULLS and QUOTED_IDENTIFIER settings, and statistics.
  • Constructor Details

    • MsView

      public MsView(String name)
      Creates a new Microsoft SQL view.
      Parameters:
      name - the view 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
    • canDropBeforeCreate

      public boolean canDropBeforeCreate()
      Description copied from class: PgStatement
      Checks if this statement can be dropped before being recreated. Override in subclasses that support drop-before-create behavior.
      Overrides:
      canDropBeforeCreate in class PgStatement
      Returns:
      true if the statement can be dropped before recreation
    • 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 AbstractView
    • 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
      Parameters:
      hasher - the hasher instance to use for hash computation
    • 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 PgStatementContainer
    • computeChildrenHash

      public void computeChildrenHash(Hasher hasher)
      Overrides:
      computeChildrenHash in class PgStatementContainer
    • setAnsiNulls

      public void setAnsiNulls(boolean ansiNulls)
    • setQuotedIdentified

      public void setQuotedIdentified(boolean quotedIdentified)
    • getFirstPart

      public String getFirstPart()
      Description copied from interface: SourceStatement
      Gets the first part of the source statement (before CREATE/ALTER).
      Specified by:
      getFirstPart in interface SourceStatement
      Returns:
      the first part of the source
    • setFirstPart

      public void setFirstPart(String firstPart)
      Description copied from interface: SourceStatement
      Sets the first part of the source statement.
      Specified by:
      setFirstPart in interface SourceStatement
      Parameters:
      firstPart - the first part to set
    • getSecondPart

      public String getSecondPart()
      Description copied from interface: SourceStatement
      Gets the second part of the source statement (after the object name).
      Specified by:
      getSecondPart in interface SourceStatement
      Returns:
      the second part of the source
    • setSecondPart

      public void setSecondPart(String secondPart)
      Description copied from interface: SourceStatement
      Sets the second part of the source statement.
      Specified by:
      setSecondPart in interface SourceStatement
      Parameters:
      secondPart - the second part to set
    • setSchemaBinding

      public void setSchemaBinding(boolean schemaBinding)
    • isSchemaBinding

      public boolean isSchemaBinding()
    • getDbType

      public DatabaseType getDbType()
      Overrides:
      getDbType in class PgStatement