Class MsAssembly

All Implemented Interfaces:
IStatement, IHashable

public class MsAssembly extends MsAbstractStatement
Represents a Microsoft SQL assembly. Assemblies allow running .NET code within SQL Server.
  • Constructor Details

    • MsAssembly

      public MsAssembly(String name)
  • Method Details

    • getStatementType

      public DbObjType getStatementType()
      Description copied from interface: IStatement
      Gets the type of this database object.
      Returns:
      the database object type
    • getCreationSQL

      public void getCreationSQL(SQLScript script)
      Description copied from interface: IStatement
      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.
      Parameters:
      script - the SQL script to append creation statements to
    • getPreview

      public String getPreview(ISettings settings)
      Returns assembly definition without full binaries for preview purposes.
      Parameters:
      settings - the settings for SQL generation
      Returns:
      the preview SQL string with truncated binaries
    • appendAlterSQL

      public ObjectState appendAlterSQL(IStatement newCondition, SQLScript script)
      Description copied from interface: IStatement
      Fill script with object changes and return change type
      Parameters:
      newCondition - new object state
      script - script to collect changes
      Returns:
      object change type
    • getDropSQL

      public void getDropSQL(SQLScript script, boolean optionExists)
      Description copied from interface: IStatement
      Generates DROP SQL for this statement.
      Specified by:
      getDropSQL in interface IStatement
      Overrides:
      getDropSQL in class AbstractStatement
      Parameters:
      script - the SQL script to append the DROP statement to
      optionExists - whether to include "IF EXISTS" in the DROP statement
    • setPermission

      public void setPermission(String permission)
    • addBinary

      public void addBinary(String binary)
      Adds a binary to this assembly.
      Parameters:
      binary - the binary data or file path
    • setVisible

      public void setVisible(boolean isVisible)
    • 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.
      Parameters:
      hasher - the hasher instance to use for hash computation
    • compare

      public boolean compare(IStatement obj)
      Description copied from class: AbstractStatement
      This method does not account for nested child PgStatements. Shallow version of AbstractStatement.equals(Object)
      Specified by:
      compare in interface IStatement
      Overrides:
      compare in class AbstractStatement