public class JooqSink
extends java.lang.Object
implements ch.ergon.adam.core.db.interfaces.SchemaSink
| Modifier and Type | Field and Description |
|---|---|
protected org.jooq.DSLContext |
context |
protected java.lang.String |
schema |
| Modifier | Constructor and Description |
|---|---|
|
JooqSink(java.sql.Connection connection,
org.jooq.SQLDialect dialect) |
protected |
JooqSink(java.sql.Connection dbConnection,
org.jooq.SQLDialect dialect,
java.lang.String schema) |
|
JooqSink(java.lang.String url) |
|
JooqSink(java.lang.String url,
java.lang.String schema) |
| Modifier and Type | Method and Description |
|---|---|
void |
addField(ch.ergon.adam.core.db.schema.Field field) |
protected java.lang.String |
castIfNeeded(ch.ergon.adam.core.db.schema.Field sourceField,
ch.ergon.adam.core.db.schema.Field targetField,
org.jooq.DSLContext renderContext) |
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 |
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 |
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 |
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) |
protected java.lang.Object |
getDefaultValue(ch.ergon.adam.core.db.schema.Field field) |
protected org.jooq.Name |
getFieldName(ch.ergon.adam.core.db.schema.Field field) |
protected org.jooq.Name |
getTableName(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) |
void |
renameTable(ch.ergon.adam.core.db.schema.Table oldTable,
java.lang.String targetTableName) |
void |
rollback() |
void |
setDefault(ch.ergon.adam.core.db.schema.Field field) |
void |
setTargetSchema(ch.ergon.adam.core.db.schema.Schema targetSchema) |
protected final org.jooq.DSLContext context
protected final java.lang.String schema
public JooqSink(java.lang.String url,
java.lang.String schema)
public JooqSink(java.lang.String url)
public JooqSink(java.sql.Connection connection,
org.jooq.SQLDialect dialect)
protected JooqSink(java.sql.Connection dbConnection,
org.jooq.SQLDialect dialect,
java.lang.String schema)
public void close()
close in interface java.lang.AutoCloseableprotected org.jooq.Name getTableName(ch.ergon.adam.core.db.schema.Table table)
protected org.jooq.Name getFieldName(ch.ergon.adam.core.db.schema.Field field)
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.SchemaSinkpublic 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 dropDefault(ch.ergon.adam.core.db.schema.Field field)
dropDefault 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 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 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 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.SchemaSinkprotected java.lang.String castIfNeeded(ch.ergon.adam.core.db.schema.Field sourceField,
ch.ergon.adam.core.db.schema.Field targetField,
org.jooq.DSLContext renderContext)
protected org.jooq.DataType<?> mapType(ch.ergon.adam.core.db.schema.Field field)
protected java.lang.Object getDefaultValue(ch.ergon.adam.core.db.schema.Field field)
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)