Class BaseSchema

    • Constructor Detail

      • BaseSchema

        public BaseSchema​(JdbcTemplate jdbcTemplate,
                          Database database,
                          String name)
        Parameters:
        jdbcTemplate - The Jdbc Template for communicating with the DB.
        database - The database-specific support.
        name - The name of the schema.
    • Method Detail

      • getDatabase

        protected Database getDatabase()
      • exists

        public final boolean exists()
        Specified by:
        exists in interface Schema
      • doExists

        protected abstract boolean doExists()
                                     throws SQLException
        Checks whether this schema exists.
        Throws:
        SQLException - when the check failed.
      • isEmpty

        public final boolean isEmpty()
        Specified by:
        isEmpty in interface Schema
      • doCheckIfEmpty

        protected abstract boolean doCheckIfEmpty()
                                           throws SQLException
        Checks whether this schema is empty.
        Throws:
        SQLException - when the check failed.
      • create

        public final void create()
        Description copied from interface: Schema
        Creates this schema in the database.
        Specified by:
        create in interface Schema
      • doCreate

        protected abstract void doCreate()
                                  throws SQLException
        Creates this schema in the database.
        Throws:
        SQLException - when the creation failed.
      • allTables

        public final List<? extends Table> allTables()
        Description copied from interface: Schema
        Retrieves all the tables in this schema.
        Specified by:
        allTables in interface Schema
      • doAllTables

        protected abstract List<? extends Table> doAllTables()
                                                      throws SQLException
        Retrieves all the tables in this schema.
        Throws:
        SQLException - when the retrieval failed.
      • toString

        public final String toString()
        Overrides:
        toString in class Object
        Returns:
        The quoted name of this schema.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object