Class BaseSchema
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseSchema
-
- All Implemented Interfaces:
Schema
- Direct Known Subclasses:
BigQuerySchema,CockroachDBSchema,DB2Schema,DerbySchema,FirebirdSchema,H2Schema,HSQLDBSchema,IgniteThinSchema,InformixSchema,MySQLSchema,OracleSchema,PostgreSQLSchema,RedshiftSchema,SAPHANASchema,SnowflakeSchema,SpannerSchema,SQLiteSchema,SQLServerSchema,SybaseASESchema
public abstract class BaseSchema extends Object implements Schema
-
-
Field Summary
Fields Modifier and Type Field Description protected JdbcTemplatejdbcTemplateprotected Stringname
-
Constructor Summary
Constructors Constructor Description BaseSchema(JdbcTemplate jdbcTemplate, Database database, String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<? extends Table>allTables()Retrieves all the tables in this schema.voidcreate()Creates this schema in the database.protected abstract List<? extends Table>doAllTables()Retrieves all the tables in this schema.protected abstract booleandoCheckIfEmpty()Checks whether this schema is empty.protected abstract voiddoCreate()Creates this schema in the database.protected abstract booleandoExists()Checks whether this schema exists.booleanequals(Object o)booleanexists()protected DatabasegetDatabase()StringgetName()inthashCode()booleanisEmpty()StringtoString()
-
-
-
Field Detail
-
jdbcTemplate
protected final JdbcTemplate jdbcTemplate
-
name
protected final String name
-
-
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()
-
doExists
protected abstract boolean doExists() throws SQLExceptionChecks whether this schema exists.- Throws:
SQLException- when the check failed.
-
doCheckIfEmpty
protected abstract boolean doCheckIfEmpty() throws SQLExceptionChecks whether this schema is empty.- Throws:
SQLException- when the check failed.
-
create
public final void create()
Description copied from interface:SchemaCreates this schema in the database.
-
doCreate
protected abstract void doCreate() throws SQLExceptionCreates this schema in the database.- Throws:
SQLException- when the creation failed.
-
allTables
public final List<? extends Table> allTables()
Description copied from interface:SchemaRetrieves all the tables in this 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()
-
-