Class MySqlObjectFactory

    • Constructor Detail

      • MySqlObjectFactory

        public MySqlObjectFactory​(Connection connection)
        Create a new MySqlObjectFactory instance.
        Parameters:
        connection - JDBC connection
    • 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