All Implemented Interfaces:
IStatement, IHashable

public class MsUser extends MsAbstractStatement
Represents a Microsoft SQL database user that can be associated with a login and have specific schema, language, and encryption settings.
  • Constructor Details

    • MsUser

      public MsUser(String name)
      Creates a new Microsoft SQL user.
      Parameters:
      name - the username
  • 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
    • 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
    • setSchema

      public void setSchema(String schema)
      Sets the default schema for this user. If the schema is 'dbo', it is ignored.
      Parameters:
      schema - the default schema name
    • setLogin

      public void setLogin(String login)
    • setLanguage

      public void setLanguage(String defaultLng)
    • setAllowEncrypted

      public void setAllowEncrypted(boolean allowEncrypted)
    • 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