Package ch.ergon.adam.postgresql
Class PostgreSqlTransactionWrapper
java.lang.Object
ch.ergon.adam.postgresql.PostgreSqlTransactionWrapper
- All Implemented Interfaces:
ch.ergon.adam.core.db.interfaces.SchemaSink,ch.ergon.adam.core.db.interfaces.SchemaSource,ch.ergon.adam.core.db.interfaces.SqlExecutor,AutoCloseable
public class PostgreSqlTransactionWrapper
extends Object
implements ch.ergon.adam.core.db.interfaces.SchemaSource, ch.ergon.adam.core.db.interfaces.SchemaSink, ch.ergon.adam.core.db.interfaces.SqlExecutor
-
Constructor Summary
ConstructorsConstructorDescriptionPostgreSqlTransactionWrapper(String url, String schema, Runnable closeHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(ch.ergon.adam.core.db.schema.Field field) voidadjustSequences(ch.ergon.adam.core.db.schema.Table table) voidvoidchangeFieldType(ch.ergon.adam.core.db.schema.Field oldField, ch.ergon.adam.core.db.schema.Field newField, ch.ergon.adam.core.db.schema.DataType targetDataType) voidclose()voidvoidvoidcopyData(ch.ergon.adam.core.db.schema.Table sourceTable, ch.ergon.adam.core.db.schema.Table targetTable, String sourceTableName) voidcreateConstraint(ch.ergon.adam.core.db.schema.Constraint constraint) voidcreateEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum) voidcreateForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey) voidcreateIndex(ch.ergon.adam.core.db.schema.Index index) voidcreateSequence(ch.ergon.adam.core.db.schema.Sequence sequence) voidcreateTable(ch.ergon.adam.core.db.schema.Table table) voidcreateView(ch.ergon.adam.core.db.schema.View view) voidvoiddropConstraint(ch.ergon.adam.core.db.schema.Constraint constraint) voiddropDefault(ch.ergon.adam.core.db.schema.Field field) voiddropEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum) voiddropField(ch.ergon.adam.core.db.schema.Field field, ch.ergon.adam.core.db.schema.Table table) voiddropForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey) voiddropIndex(ch.ergon.adam.core.db.schema.Index index) voidvoiddropSequence(ch.ergon.adam.core.db.schema.Sequence sequence) voiddropSequencesAndDefaults(ch.ergon.adam.core.db.schema.Table table) voiddropTable(ch.ergon.adam.core.db.schema.Table table) voiddropView(ch.ergon.adam.core.db.schema.View view) voidexecuteScript(String script) intch.ergon.adam.core.db.schema.SchemavoidbooleanisClosed()queryResult(String query, Object... params) voidvoidrenameTable(ch.ergon.adam.core.db.schema.Table oldTable, String targetTableName) voidrollback()voidvoidsetDefault(ch.ergon.adam.core.db.schema.Field field) voidsetTargetSchema(ch.ergon.adam.core.db.schema.Schema targetSchema) boolean
-
Constructor Details
-
PostgreSqlTransactionWrapper
-
-
Method Details
-
increaseClientCount
public void increaseClientCount() -
decreaseClientCount
public void decreaseClientCount() -
getClientCount
public int getClientCount() -
beginTransaction
public void beginTransaction() -
commitTransaction
public void commitTransaction() -
rollbackTransaction
public void rollbackTransaction() -
setTargetSchema
public void setTargetSchema(ch.ergon.adam.core.db.schema.Schema targetSchema) - Specified by:
setTargetSchemain interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
commitChanges
public void commitChanges()- Specified by:
commitChangesin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
rollback
public void rollback()- Specified by:
rollbackin interfacech.ergon.adam.core.db.interfaces.SchemaSink- Specified by:
rollbackin interfacech.ergon.adam.core.db.interfaces.SqlExecutor
-
dropForeignKey
public void dropForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey) - Specified by:
dropForeignKeyin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createForeignKey
public void createForeignKey(ch.ergon.adam.core.db.schema.ForeignKey foreignKey) - Specified by:
createForeignKeyin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropIndex
public void dropIndex(ch.ergon.adam.core.db.schema.Index index) - Specified by:
dropIndexin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createIndex
public void createIndex(ch.ergon.adam.core.db.schema.Index index) - Specified by:
createIndexin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
addField
public void addField(ch.ergon.adam.core.db.schema.Field field) - Specified by:
addFieldin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropField
public void dropField(ch.ergon.adam.core.db.schema.Field field, ch.ergon.adam.core.db.schema.Table table) - Specified by:
dropFieldin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
setDefault
public void setDefault(ch.ergon.adam.core.db.schema.Field field) - Specified by:
setDefaultin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropDefault
public void dropDefault(ch.ergon.adam.core.db.schema.Field field) - Specified by:
dropDefaultin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createTable
public void createTable(ch.ergon.adam.core.db.schema.Table table) - Specified by:
createTablein interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropTable
public void dropTable(ch.ergon.adam.core.db.schema.Table table) - Specified by:
dropTablein interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
renameTable
- Specified by:
renameTablein interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
copyData
public void copyData(ch.ergon.adam.core.db.schema.Table sourceTable, ch.ergon.adam.core.db.schema.Table targetTable, String sourceTableName) - Specified by:
copyDatain interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createView
public void createView(ch.ergon.adam.core.db.schema.View view) - Specified by:
createViewin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropView
public void dropView(ch.ergon.adam.core.db.schema.View view) - Specified by:
dropViewin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropEnum
public void dropEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum) - Specified by:
dropEnumin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createEnum
public void createEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum) - Specified by:
createEnumin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
changeFieldType
public 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) - Specified by:
changeFieldTypein interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropConstraint
public void dropConstraint(ch.ergon.adam.core.db.schema.Constraint constraint) - Specified by:
dropConstraintin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createConstraint
public void createConstraint(ch.ergon.adam.core.db.schema.Constraint constraint) - Specified by:
createConstraintin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropSequence
public void dropSequence(ch.ergon.adam.core.db.schema.Sequence sequence) - Specified by:
dropSequencein interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
createSequence
public void createSequence(ch.ergon.adam.core.db.schema.Sequence sequence) - Specified by:
createSequencein interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
dropSequencesAndDefaults
public void dropSequencesAndDefaults(ch.ergon.adam.core.db.schema.Table table) - Specified by:
dropSequencesAndDefaultsin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
adjustSequences
public void adjustSequences(ch.ergon.adam.core.db.schema.Table table) - Specified by:
adjustSequencesin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
executeScript
- Specified by:
executeScriptin interfacech.ergon.adam.core.db.interfaces.SqlExecutor
-
queryResult
- Specified by:
queryResultin interfacech.ergon.adam.core.db.interfaces.SqlExecutor
-
dropSchema
public void dropSchema()- Specified by:
dropSchemain interfacech.ergon.adam.core.db.interfaces.SqlExecutor
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
reallyClose
public void reallyClose() -
isClosed
public boolean isClosed() -
supportAlterAndDropField
public boolean supportAlterAndDropField()- Specified by:
supportAlterAndDropFieldin interfacech.ergon.adam.core.db.interfaces.SchemaSink
-
getSchema
public ch.ergon.adam.core.db.schema.Schema getSchema()- Specified by:
getSchemain interfacech.ergon.adam.core.db.interfaces.SchemaSource
-
getConnection
-