Class MsDatabase

All Implemented Interfaces:
IHashable, IDatabase, IStatement, IStatementContainer

public final class MsDatabase extends AbstractDatabase
Represents a Microsoft SQL database with its schemas, assemblies, roles, and users. Provides functionality for managing database-level objects and their relationships.
  • Constructor Details

    • MsDatabase

      public MsDatabase()
  • Method Details

    • getChild

      public PgStatement getChild(String name, DbObjType type)
      Description copied from interface: IStatementContainer
      Gets a child statement by name and type.
      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
    • addChild

      public void addChild(IStatement st)
      Description copied from interface: IStatementContainer
      Adds a child statement to this container.
      Parameters:
      st - the child statement to add
    • getAssembly

      public MsAssembly getAssembly(String name)
      Returns assembly of given name or null if the assembly has not been found.
      Parameters:
      name - assembly name
      Returns:
      found assembly or null
    • getRole

      public MsRole getRole(String name)
      Returns role of given name or null if the role has not been found.
      Parameters:
      name - role name
      Returns:
      found role or null
    • getUser

      public MsUser getUser(String name)
      Returns user of given name or null if the user has not been found.
      Parameters:
      name - user name
      Returns:
      found user or null
    • getAssemblies

      public Collection<MsAssembly> getAssemblies()
      Gets all assemblies in this database.
      Returns:
      unmodifiable collection of assemblies
    • getRoles

      public Collection<MsRole> getRoles()
      Gets all roles in this database.
      Returns:
      unmodifiable collection of roles
    • getUsers

      public Collection<MsUser> getUsers()
      Getter for users. The list cannot be modified.
      Returns:
      users
    • addAssembly

      public void addAssembly(MsAssembly assembly)
      Adds an assembly to this database.
      Parameters:
      assembly - the assembly to add
    • addRole

      public void addRole(MsRole role)
      Adds a role to this database.
      Parameters:
      role - the role to add
    • addUser

      public void addUser(MsUser user)
      Adds a user to this database.
      Parameters:
      user - the user to add
    • 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 AbstractDatabase
    • computeChildrenHash

      public void computeChildrenHash(Hasher hasher)
      Overrides:
      computeChildrenHash in class AbstractDatabase
    • getDbType

      public DatabaseType getDbType()
      Overrides:
      getDbType in class PgStatement