Class AbstractObjectFactory

    • Constructor Detail

      • AbstractObjectFactory

        protected AbstractObjectFactory​(DatabaseObjectWriter writer)
        Create a new instance
        Parameters:
        writer - a database object writer
    • Method Detail

      • executeSqlFile

        public void executeSqlFile​(Path... sqlFiles)
        Description copied from interface: DatabaseObjectFactory
        Execute the contents of one or more SQL script files. Each file may contain multiple SQL statements, separated with ;.
        Specified by:
        executeSqlFile in interface DatabaseObjectFactory
        Parameters:
        sqlFiles - paths to the script files
      • 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 TDBJ is made. Never use something like this in production code!

        Specified by:
        createUser in interface DatabaseObjectFactory
        Parameters:
        name - user name
        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 TDBJ is made. Never use something like this in production code!

        Specified by:
        createLoginUser in interface DatabaseObjectFactory
        Parameters:
        name - user name
        Returns:
        new User instance
      • writeUser

        protected <T extends User> T writeUser​(T user)
        Write the given User to the database. The method returns the user to allow creating, writing and returning in a single line.
        Type Parameters:
        T - the concrete user type
        Parameters:
        user - the user to write
        Returns:
        the user
      • writeSchema

        protected <T extends Schema> T writeSchema​(T schema)
        Write the given Schema to the database. The method returns the schema to allow creating, writing and returning in a single line.
        Type Parameters:
        T - the concrete schema type
        Parameters:
        schema - the schema to write
        Returns:
        the schema