Class BaseSchema<D extends Database<?>,​T extends Table<?,​?>>

    • Field Detail

      • database

        protected final D extends Database<?> database
      • name

        protected final String name
    • Constructor Detail

      • BaseSchema

        public BaseSchema​(JdbcTemplate jdbcTemplate,
                          D 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

      • doExists

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

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

        public void create()
        Description copied from interface: Schema
        Creates this schema in the database.
        Specified by:
        create in interface Schema<D extends Database<?>,​T extends Table<?,​?>>
      • doCreate

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

        public void drop()
        Description copied from interface: Schema
        Drops this schema from the database.
        Specified by:
        drop in interface Schema<D extends Database<?>,​T extends Table<?,​?>>
      • doDrop

        protected abstract void doDrop()
                                throws SQLException
        Drops this schema from the database.
        Throws:
        SQLException - when the drop failed.
      • clean

        public void clean()
        Description copied from interface: Schema
        Cleans all the objects in this schema.
        Specified by:
        clean in interface Schema<D extends Database<?>,​T extends Table<?,​?>>
      • doClean

        protected abstract void doClean()
                                 throws SQLException
        Cleans all the objects in this schema.
        Throws:
        SQLException - when the clean failed.
      • allTables

        public T[] allTables()
        Description copied from interface: Schema
        Retrieves all the tables in this schema.
        Specified by:
        allTables in interface Schema<D extends Database<?>,​T extends Table<?,​?>>
      • doAllTables

        protected abstract T[] doAllTables()
                                    throws SQLException
        Retrieves all the tables in this schema.
        Throws:
        SQLException - when the retrieval failed.
      • allTypes

        protected final Type<?,​?>[] allTypes()
        Retrieves all the types in this schema.
      • getType

        protected Type<?,​?> getType​(String typeName)
        Retrieves the type with this name in this schema.
      • allFunctions

        protected final Function<?,​?>[] allFunctions()
        Retrieves all the functions in this schema.
      • doAllFunctions

        protected Function<?,​?>[] doAllFunctions()
                                                throws SQLException
        Retrieves all the functions in this schema.
        Throws:
        SQLException - when the retrieval failed.
      • toString

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

        public int hashCode()
        Overrides:
        hashCode in class Object