Class User

    • Constructor Detail

      • User

        public User​(DatabaseObjectWriter writer,
                    String name)
        Create a new database user with a default password.

        This method creates a user with a password derived from the user name. Note that this is only acceptable in the scope of testing for which the TDDB is made. Never use something like this in production code!

        Parameters:
        writer - database object writer
        name - user name
      • User

        public User​(DatabaseObjectWriter writer,
                    String name,
                    String password)
        Create a new database user.
        Parameters:
        writer - database object writer
        name - user name
        password - login password
    • Method Detail

      • getType

        public String getType()
        Description copied from interface: DatabaseObject
        Get the type of the database object.
        Returns:
        type of the database object
      • hasParent

        public boolean hasParent()
        Description copied from interface: DatabaseObject
        Check if this object has a parent object that sets the scope within the database
        Returns:
        true if the object has a parent
      • getParent

        public DatabaseObject getParent()
        Description copied from interface: DatabaseObject
        Get the parent object.
        Returns:
        parent object
      • getPassword

        public String getPassword()
        Get the user's password.
        Returns:
        password
      • getSystemPrivileges

        public Set<SystemPrivilege> getSystemPrivileges()
        Get the systemPrivileges of the user.
        Returns:
        system privileges
      • grantAllAccess

        public User grantAllAccess​(DatabaseObject object)
        Grant the user access to all aspects of a database schema.
        Parameters:
        object - database object
        Returns:
        User instance for fluent programming
      • grant

        public User grant​(DatabaseObject object,
                          ObjectPrivilege... privileges)
        Grant the user access to a database schema with the given privileges.
        Parameters:
        object - database object
        privileges - privileges to grant the user
        Returns:
        User instance for fluent programming
      • grant

        public User grant​(SystemPrivilege... privileges)
        Grant system privileges to a user.
        Parameters:
        privileges - system privileges
        Returns:
        User instance for fluent programming