Class SqlSchemaAdapter
java.lang.Object
ch.nolix.system.sqlschema.adapter.SqlSchemaAdapter
- All Implemented Interfaces:
Closeable, CloseStateRequestable, GroupCloseable, ChangeRequestable, IChangeSaver, IResettableChangeSaver, Resettable, ISchemaAdapter, ISchemaReader, ISchemaWriter, AutoCloseable
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdditionalSqlStatements(IContainer<String> additionalSqlStatements) voidaddColumn(TableIdentification table, ColumnDto column) voidaddColumns(TableIdentification table, IContainer<ColumnDto> columns) voidvoidaddTables(IContainer<TableDto> tables) voidbooleancolumnIsEmpty(String tableName, String columnName) voiddeleteColumn(String tableName, String columnName) voiddeleteColumnIfExists(String tableName, String columnName) voiddeleteTable(String tableName) static SqlSchemaAdapterforDatabaseNameAndWithSqlConnectionPool(String databaseName, IResourcePool<ISqlConnection> sqlConnectionPool) intintbooleanvoidLets the currentGroupCloseablenote a close.voidrenameColumn(String tableName, String columnName, String newColumnName) voidrenameColumnIfExists(String tableName, String columnName, String newColumnName) voidrenameTable(String tableName, String newTableName) voidreset()Resets the currentResettable.voidSaves the changes of the currentIChangeSaver.booleanbooleantableExists(String tableName) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChangeRequestable
isChangeFreeMethods inherited from interface CloseStateRequestable
isOpenMethods inherited from interface GroupCloseable
close, createCloseDependencyTo, isClosed
-
Method Details
-
forDatabaseNameAndWithSqlConnectionPool
public static SqlSchemaAdapter forDatabaseNameAndWithSqlConnectionPool(String databaseName, IResourcePool<ISqlConnection> sqlConnectionPool) -
addAdditionalSqlStatements
- Specified by:
addAdditionalSqlStatementsin interfaceISchemaWriter
-
addColumn
- Specified by:
addColumnin interfaceISchemaWriter
-
addColumns
- Specified by:
addColumnsin interfaceISchemaWriter
-
addTable
- Specified by:
addTablein interfaceISchemaWriter
-
addTables
- Specified by:
addTablesin interfaceISchemaWriter
-
addTables
- Specified by:
addTablesin interfaceISchemaWriter
-
columnIsEmpty
- Specified by:
columnIsEmptyin interfaceISchemaReader
-
deleteColumn
- Specified by:
deleteColumnin interfaceISchemaWriter
-
deleteColumnIfExists
- Specified by:
deleteColumnIfExistsin interfaceISchemaWriter
-
deleteTable
- Specified by:
deleteTablein interfaceISchemaWriter
-
getStoredCloseController
- Specified by:
getStoredCloseControllerin interfaceGroupCloseable- Returns:
- the
ICloseControllerof the currentGroupCloseable.
-
getSaveCount
public int getSaveCount()- Specified by:
getSaveCountin interfaceIResettableChangeSaver
-
hasChanges
public boolean hasChanges()- Specified by:
hasChangesin interfaceChangeRequestable- Returns:
- true if the current
ChangeRequestablehas uncomitted changes, false otherwise.
-
loadTable
- Specified by:
loadTablein interfaceISchemaReader
-
getTableCount
public int getTableCount()- Specified by:
getTableCountin interfaceISchemaReader
-
loadTables
- Specified by:
loadTablesin interfaceISchemaReader
-
noteClose
public void noteClose()Lets the currentGroupCloseablenote a close.- Specified by:
noteClosein interfaceGroupCloseable
-
renameColumn
- Specified by:
renameColumnin interfaceISchemaWriter
-
renameColumnIfExists
- Specified by:
renameColumnIfExistsin interfaceISchemaWriter
-
renameTable
- Specified by:
renameTablein interfaceISchemaWriter
-
reset
-
saveChanges
public void saveChanges()Saves the changes of the currentIChangeSaver.- Specified by:
saveChangesin interfaceIChangeSaver
-
tableExist
public boolean tableExist()- Specified by:
tableExistin interfaceISchemaReader
-
tableExists
- Specified by:
tableExistsin interfaceISchemaReader
-