Class BaseTableDdl
- java.lang.Object
-
- io.ebeaninternal.dbmigration.ddlgeneration.platform.BaseTableDdl
-
- All Implemented Interfaces:
TableDdl
- Direct Known Subclasses:
ClickHouseTableDdl
,HanaTableDdl
public class BaseTableDdl extends Object implements TableDdl
Base implementation for 'create table' and 'alter table' statements.
-
-
Constructor Summary
Constructors Constructor Description BaseTableDdl(ServerConfig serverConfig, PlatformDdl platformDdl)
Construct with a naming convention and platform specific DDL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate(DdlWrite writer, AddColumn addColumn)
Add add column DDL.void
generate(DdlWrite writer, AddHistoryTable addHistoryTable)
Add add history table DDL.void
generate(DdlWrite writer, AddTableComment addTableComment)
Write the AddTableComment change.void
generate(DdlWrite writer, AddUniqueConstraint constraint)
Write add unique constraint.void
generate(DdlWrite writer, AlterColumn alterColumn)
Add all the appropriate changes based on the column changes.void
generate(DdlWrite writer, AlterForeignKey alterForeignKey)
Writes alter foreign key statements.void
generate(DdlWrite writer, CreateIndex index)
Generate the create index change.void
generate(DdlWrite writer, CreateTable createTable)
Generate the appropriate 'create table' and matching 'drop table' statements and add them to the appropriate 'apply' and 'rollback' buffers.void
generate(DdlWrite writer, DropColumn dropColumn)
Add drop column DDL.void
generate(DdlWrite writer, DropHistoryTable dropHistoryTable)
Add drop history table DDL.void
generate(DdlWrite writer, DropIndex dropIndex)
Write the drop index change.void
generate(DdlWrite writer, DropTable dropTable)
Add drop table DDL.void
generateEpilog(DdlWrite write)
Called at the end to generate additional ddl such as regenerate history triggers.void
generateProlog(DdlWrite write)
Generate any extra DDL such as stored procedures or TableValueParameters.
-
-
-
Constructor Detail
-
BaseTableDdl
public BaseTableDdl(ServerConfig serverConfig, PlatformDdl platformDdl)
Construct with a naming convention and platform specific DDL.
-
-
Method Detail
-
generate
public void generate(DdlWrite writer, CreateTable createTable) throws IOException
Generate the appropriate 'create table' and matching 'drop table' statements and add them to the appropriate 'apply' and 'rollback' buffers.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, CreateIndex index) throws IOException
Description copied from interface:TableDdl
Generate the create index change.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, DropIndex dropIndex) throws IOException
Description copied from interface:TableDdl
Write the drop index change.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, AddUniqueConstraint constraint) throws IOException
Description copied from interface:TableDdl
Write add unique constraint.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, AlterForeignKey alterForeignKey) throws IOException
Description copied from interface:TableDdl
Writes alter foreign key statements.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, AddHistoryTable addHistoryTable) throws IOException
Add add history table DDL.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, DropHistoryTable dropHistoryTable) throws IOException
Add drop history table DDL.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generateProlog
public void generateProlog(DdlWrite write) throws IOException
Description copied from interface:TableDdl
Generate any extra DDL such as stored procedures or TableValueParameters.- Specified by:
generateProlog
in interfaceTableDdl
- Throws:
IOException
-
generateEpilog
public void generateEpilog(DdlWrite write) throws IOException
Called at the end to generate additional ddl such as regenerate history triggers.- Specified by:
generateEpilog
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, AddTableComment addTableComment) throws IOException
Description copied from interface:TableDdl
Write the AddTableComment change.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, AddColumn addColumn) throws IOException
Add add column DDL.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, DropTable dropTable) throws IOException
Add drop table DDL.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, DropColumn dropColumn) throws IOException
Add drop column DDL.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
generate
public void generate(DdlWrite writer, AlterColumn alterColumn) throws IOException
Add all the appropriate changes based on the column changes.- Specified by:
generate
in interfaceTableDdl
- Throws:
IOException
-
-