public final class DdlAdaptor extends Object
Constructor and Description |
---|
DdlAdaptor(DdlGenerator ddlGenerator,
DdlConsumer ddlConsumer) |
Modifier and Type | Method and Description |
---|---|
void |
alterSequence(Connection conn,
SequenceElement s)
Alters sequence in the database.
|
void |
createColumn(Connection conn,
Column<?> c)
Adds a new column to the table.
|
void |
createFk(Connection conn,
ForeignKey fk)
Creates foreign key in the DB.
|
void |
createIndex(Connection conn,
Index index)
Creates a table index in the grain.
|
void |
createParameterizedView(Connection conn,
ParameterizedView pv) |
void |
createPk(Connection conn,
TableElement t)
Creates primary key in the table according to meta description.
|
void |
createSchema(Connection conn,
String name)
Creates DB schema.
|
void |
createSequence(Connection conn,
SequenceElement s)
Creates a sequence in the database.
|
void |
createTable(Connection conn,
TableElement te)
Creates a table "from scratch" in the database.
|
void |
createTableTriggersForMaterializedViews(Connection conn,
BasicTable t) |
void |
createView(Connection conn,
View v)
Creates a view in the database from metadata.
|
void |
dropFK(Connection conn,
String schemaName,
String tableName,
String fkName)
Drops foreign key of table in a scheme.
|
void |
dropIndex(Connection conn,
Grain g,
DbIndexInfo dBIndexInfo)
Drops index of a grain.
|
void |
dropParameterizedView(Connection conn,
String schemaName,
String viewName) |
void |
dropPk(Connection conn,
TableElement t,
String pkName)
Drops primary key from the table by using known name of the primary key.
|
void |
dropTable(Connection conn,
TableElement t)
Deletes table from RDBMS.
|
void |
dropTableTriggersForMaterializedViews(Connection conn,
BasicTable t) |
void |
dropTrigger(Connection conn,
TriggerQuery query)
Drops a trigger from DB.
|
void |
dropView(Connection conn,
String schemaName,
String viewName)
Drops view from a DB schema.
|
void |
executeNative(Connection conn,
String sql)
Executes native SQL query.
|
SQLGenerator |
getViewSQLGenerator() |
void |
initDataForMaterializedView(Connection conn,
MaterializedView mv) |
void |
updateColumn(Connection conn,
Column<?> c,
DbColumnInfo actual)
Updates a table column.
|
void |
updateVersioningTrigger(Connection conn,
TableElement t) |
public DdlAdaptor(DdlGenerator ddlGenerator, DdlConsumer ddlConsumer)
public void createSchema(Connection conn, String name)
conn
- DB connectionname
- schema namepublic void dropView(Connection conn, String schemaName, String viewName)
conn
- DB connectionschemaName
- schema nameviewName
- view namepublic void dropParameterizedView(Connection conn, String schemaName, String viewName)
public void dropIndex(Connection conn, Grain g, DbIndexInfo dBIndexInfo)
conn
- DB connectiong
- graindBIndexInfo
- index informationpublic void dropFK(Connection conn, String schemaName, String tableName, String fkName)
conn
- DB connectionschemaName
- grain nametableName
- table name for column(s) of which FK is declaredfkName
- name of foreign keypublic void dropTrigger(Connection conn, TriggerQuery query)
conn
- Connectionquery
- Trigger querypublic void createSequence(Connection conn, SequenceElement s)
conn
- DB connections
- sequence elementpublic void alterSequence(Connection conn, SequenceElement s)
conn
- DB connections
- sequence elementpublic void createTable(Connection conn, TableElement te)
conn
- Connectionte
- Table for creation (accepts also table in case if such table exists)public void updateVersioningTrigger(Connection conn, TableElement t)
public void dropPk(Connection conn, TableElement t, String pkName)
conn
- DB connectiont
- tablepkName
- primary key namepublic void updateColumn(Connection conn, Column<?> c, DbColumnInfo actual)
conn
- DB connectionc
- Column to updateactual
- Actual column infopublic void createColumn(Connection conn, Column<?> c)
conn
- DB connectionc
- columnpublic void createPk(Connection conn, TableElement t)
conn
- database connectiont
- tablepublic void createIndex(Connection conn, Index index)
conn
- DB connectionindex
- index descriptionpublic void createFk(Connection conn, ForeignKey fk)
conn
- DB connectionfk
- foreign key from scorepublic void createView(Connection conn, View v)
conn
- DB connectionv
- View from scorepublic SQLGenerator getViewSQLGenerator()
public void createParameterizedView(Connection conn, ParameterizedView pv)
public void dropTable(Connection conn, TableElement t)
conn
- Connection to use.t
- TableElement metadata of deletable table provided by Celesta.public void initDataForMaterializedView(Connection conn, MaterializedView mv)
public void dropTableTriggersForMaterializedViews(Connection conn, BasicTable t)
public void createTableTriggersForMaterializedViews(Connection conn, BasicTable t)
public void executeNative(Connection conn, String sql)
conn
- DB connectionsql
- SQL to executeCopyright © 2022 CURS. All rights reserved.