public class PostgreSqlTransactionWrapper
extends java.lang.Object
implements ch.ergon.adam.core.db.interfaces.SchemaSource, ch.ergon.adam.core.db.interfaces.SchemaSink, ch.ergon.adam.core.db.interfaces.SqlExecutor
| Constructor and Description |
|---|
PostgreSqlTransactionWrapper(java.lang.String url,
java.lang.String schema,
java.lang.Runnable closeHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addField(ch.ergon.adam.core.db.schema.Field field) |
void |
beginTransaction() |
void |
changeFieldType(ch.ergon.adam.core.db.schema.Field oldField,
ch.ergon.adam.core.db.schema.Field newField,
ch.ergon.adam.core.db.schema.DataType targetDataType) |
void |
close() |
void |
commitChanges() |
void |
commitTransaction() |
void |
copyData(ch.ergon.adam.core.db.schema.Table sourceTable,
ch.ergon.adam.core.db.schema.Table targetTable,
java.lang.String sourceTableName) |
void |
createConstraint(ch.ergon.adam.core.db.schema.Constraint constraint) |
void |
createEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum) |
void |
createForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey) |
void |
createIndex(ch.ergon.adam.core.db.schema.Index index) |
void |
createSequence(ch.ergon.adam.core.db.schema.Sequence sequence) |
void |
createTable(ch.ergon.adam.core.db.schema.Table table) |
void |
createView(ch.ergon.adam.core.db.schema.View view) |
void |
decreaseClientCount() |
void |
dropConstraint(ch.ergon.adam.core.db.schema.Constraint constraint) |
void |
dropDefault(ch.ergon.adam.core.db.schema.Field field) |
void |
dropEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum) |
void |
dropField(ch.ergon.adam.core.db.schema.Field field,
ch.ergon.adam.core.db.schema.Table table) |
void |
dropForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey) |
void |
dropIndex(ch.ergon.adam.core.db.schema.Index index) |
void |
dropSchema() |
void |
dropSequence(ch.ergon.adam.core.db.schema.Sequence sequence) |
void |
dropSequencesAndDefaults(ch.ergon.adam.core.db.schema.Table table) |
void |
dropTable(ch.ergon.adam.core.db.schema.Table table) |
void |
dropView(ch.ergon.adam.core.db.schema.View view) |
void |
executeScript(java.lang.String script) |
int |
getClientCount() |
java.sql.Connection |
getConnection() |
ch.ergon.adam.core.db.schema.Schema |
getSchema() |
void |
increaseClientCount() |
boolean |
isClosed() |
java.lang.Object |
queryResult(java.lang.String query,
java.lang.Object... params) |
void |
reallyClose() |
void |
renameTable(ch.ergon.adam.core.db.schema.Table oldTable,
java.lang.String targetTableName) |
void |
rollback() |
void |
rollbackTransaction() |
void |
setDefault(ch.ergon.adam.core.db.schema.Field field) |
void |
setTargetSchema(ch.ergon.adam.core.db.schema.Schema targetSchema) |
boolean |
supportAlterAndDropField() |
public PostgreSqlTransactionWrapper(java.lang.String url,
java.lang.String schema,
java.lang.Runnable closeHandler)
public void increaseClientCount()
public void decreaseClientCount()
public int getClientCount()
public void beginTransaction()
public void commitTransaction()
public void rollbackTransaction()
public void setTargetSchema(ch.ergon.adam.core.db.schema.Schema targetSchema)
setTargetSchema in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void commitChanges()
commitChanges in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void rollback()
rollback in interface ch.ergon.adam.core.db.interfaces.SchemaSinkrollback in interface ch.ergon.adam.core.db.interfaces.SqlExecutorpublic void dropForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey)
dropForeignKey in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey)
createForeignKey in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropIndex(ch.ergon.adam.core.db.schema.Index index)
dropIndex in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createIndex(ch.ergon.adam.core.db.schema.Index index)
createIndex in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void addField(ch.ergon.adam.core.db.schema.Field field)
addField in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropField(ch.ergon.adam.core.db.schema.Field field,
ch.ergon.adam.core.db.schema.Table table)
dropField in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void setDefault(ch.ergon.adam.core.db.schema.Field field)
setDefault in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropDefault(ch.ergon.adam.core.db.schema.Field field)
dropDefault in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createTable(ch.ergon.adam.core.db.schema.Table table)
createTable in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropTable(ch.ergon.adam.core.db.schema.Table table)
dropTable in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void renameTable(ch.ergon.adam.core.db.schema.Table oldTable,
java.lang.String targetTableName)
renameTable in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void copyData(ch.ergon.adam.core.db.schema.Table sourceTable,
ch.ergon.adam.core.db.schema.Table targetTable,
java.lang.String sourceTableName)
copyData in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createView(ch.ergon.adam.core.db.schema.View view)
createView in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropView(ch.ergon.adam.core.db.schema.View view)
dropView in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum)
dropEnum in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum)
createEnum in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void changeFieldType(ch.ergon.adam.core.db.schema.Field oldField,
ch.ergon.adam.core.db.schema.Field newField,
ch.ergon.adam.core.db.schema.DataType targetDataType)
changeFieldType in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropConstraint(ch.ergon.adam.core.db.schema.Constraint constraint)
dropConstraint in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createConstraint(ch.ergon.adam.core.db.schema.Constraint constraint)
createConstraint in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropSequence(ch.ergon.adam.core.db.schema.Sequence sequence)
dropSequence in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void createSequence(ch.ergon.adam.core.db.schema.Sequence sequence)
createSequence in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void dropSequencesAndDefaults(ch.ergon.adam.core.db.schema.Table table)
dropSequencesAndDefaults in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic void executeScript(java.lang.String script)
executeScript in interface ch.ergon.adam.core.db.interfaces.SqlExecutorpublic java.lang.Object queryResult(java.lang.String query,
java.lang.Object... params)
queryResult in interface ch.ergon.adam.core.db.interfaces.SqlExecutorpublic void dropSchema()
dropSchema in interface ch.ergon.adam.core.db.interfaces.SqlExecutorpublic void close()
close in interface java.lang.AutoCloseablepublic void reallyClose()
public boolean isClosed()
public boolean supportAlterAndDropField()
supportAlterAndDropField in interface ch.ergon.adam.core.db.interfaces.SchemaSinkpublic ch.ergon.adam.core.db.schema.Schema getSchema()
getSchema in interface ch.ergon.adam.core.db.interfaces.SchemaSourcepublic java.sql.Connection getConnection()