Class PostgreSqlObjectFactory

    • Constructor Detail

      • PostgreSqlObjectFactory

        public PostgreSqlObjectFactory​(Connection connectionToPostgres)
        Create a new instance of PostgreSqlObjectFactory.
        Parameters:
        connectionToPostgres - connection to the PostgreSQL database.
    • Method Detail

      • createUser

        public User createUser​(String name)
        Description copied from interface: DatabaseObjectFactory
        /** 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:
        name - user name
        Returns:
        new User instance
      • createUser

        public User createUser​(String name,
                               String password)
        Description copied from interface: DatabaseObjectFactory
        Create a new database user.
        Parameters:
        name - user name
        password - login password
        Returns:
        new User instance
      • createLoginUser

        public User createLoginUser​(String name)
        Description copied from interface: DatabaseObjectFactory
        Create user that can log into the database 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:
        name - user name
        Returns:
        new User instance
      • createLoginUser

        public User createLoginUser​(String name,
                                    String password)
        Description copied from interface: DatabaseObjectFactory
        Create user that can log into the database.
        Parameters:
        name - user name
        password - login password
        Returns:
        new User instance
      • createSchema

        public Schema createSchema​(String name)
        Description copied from interface: DatabaseObjectFactory
        Create a new database schema.
        Parameters:
        name - name of the schema
        Returns:
        new Schema