Package ch.ergon.adam.jooq
Class JooqSink
java.lang.Object
ch.ergon.adam.jooq.JooqSink
- All Implemented Interfaces:
ch.ergon.adam.core.db.interfaces.SchemaSink,AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionJooqSink(Connection connection, org.jooq.SQLDialect dialect) protectedJooqSink(Connection dbConnection, org.jooq.SQLDialect dialect, String schema) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(ch.ergon.adam.core.db.schema.Field field) voidadjustSequences(ch.ergon.adam.core.db.schema.Table table) protected StringcastIfNeeded(ch.ergon.adam.core.db.schema.Field sourceField, ch.ergon.adam.core.db.schema.Field targetField, org.jooq.DSLContext renderContext) voidchangeFieldType(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()voidvoidcopyData(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) voiddropConstraint(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) voiddropSequence(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) protected ObjectgetDefaultValue(ch.ergon.adam.core.db.schema.Field field) protected org.jooq.NamegetFieldName(ch.ergon.adam.core.db.schema.Field field) protected org.jooq.NamegetTableName(ch.ergon.adam.core.db.schema.Table table) protected org.jooq.DataType<?> mapFieldToJooqType(ch.ergon.adam.core.db.schema.Field field) protected org.jooq.DataType<?> mapRawType(ch.ergon.adam.core.db.schema.DataType type) protected org.jooq.DataType<?> mapType(ch.ergon.adam.core.db.schema.Field field) voidrenameTable(ch.ergon.adam.core.db.schema.Table oldTable, String targetTableName) voidrollback()voidsetDefault(ch.ergon.adam.core.db.schema.Field field) voidsetTargetSchema(ch.ergon.adam.core.db.schema.Schema targetSchema) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.ergon.adam.core.db.interfaces.SchemaSink
supportAlterAndDropField
-
Field Details
-
context
protected final org.jooq.DSLContext context -
schema
-
-
Constructor Details
-
JooqSink
-
JooqSink
-
JooqSink
-
JooqSink
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getTableName
protected org.jooq.Name getTableName(ch.ergon.adam.core.db.schema.Table table) -
getFieldName
protected org.jooq.Name getFieldName(ch.ergon.adam.core.db.schema.Field field) -
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
-
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
-
dropDefault
public void dropDefault(ch.ergon.adam.core.db.schema.Field field) - Specified by:
dropDefaultin 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
-
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
-
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
-
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
-
castIfNeeded
protected String castIfNeeded(ch.ergon.adam.core.db.schema.Field sourceField, ch.ergon.adam.core.db.schema.Field targetField, org.jooq.DSLContext renderContext) -
mapType
protected org.jooq.DataType<?> mapType(ch.ergon.adam.core.db.schema.Field field) -
getDefaultValue
-
mapFieldToJooqType
protected org.jooq.DataType<?> mapFieldToJooqType(ch.ergon.adam.core.db.schema.Field field) -
mapRawType
protected org.jooq.DataType<?> mapRawType(ch.ergon.adam.core.db.schema.DataType type)
-