io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean-ddl-generator Show documentation
Show all versions of ebean-ddl-generator Show documentation
DDL and DB Migration generation
package io.ebeaninternal.dbmigration.ddlgeneration;
import java.io.IOException;
/**
* Object that represents an Alter Table statements. Table alters are grouped together by tableName in DDL and can be extended by
* a ddl-specific handler (e.g. doing a reorg for DB2 or implement special grouping for Hana). There is one instance per table.
*
* @author TODO Roland Praml, FOCONIS AG
*/
public interface DdlAlterTable {
/**
* Writes the alter table statements to target
*/
void write(Appendable target) throws IOException;
/**
* Adds an alter table command for given column. When you invoke
* alterTable(writer, "my_table").add("alter column","my_column).append("type integer")
the resulting DDL (in
* standard implementation) would be
* alter table my_table alter column my_column type integer
*
* @return a DdlBuffer, which can be used for further appends. Note you MUST NOT call .endOfStatement()
on this
* buffer.
*/
DdlBuffer append(String operation, String columnName);
/**
* Adds a raw command. This is mainly used for executing user stored procedures.
*/
DdlBuffer raw(String string);
/**
* Flag that detects if history DDL (switching on) is handled for this table.
*/
boolean isHistoryHandled();
/**
* Sets the history handled flag for this table.
*/
void setHistoryHandled();
}