public abstract class BaseDBProcess extends java.lang.Object implements DBProcess
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
connection |
Constructor and Description |
---|
BaseDBProcess() |
Modifier and Type | Method and Description |
---|---|
protected void |
addIndexes(java.sql.Connection connection,
java.util.List<IndexMetadata> indexMetadatas) |
protected void |
alterColumnName(java.lang.String tableName,
java.lang.String oldColumnName,
java.lang.String newColumnDefinition) |
protected void |
alterColumnType(java.lang.String tableName,
java.lang.String columnName,
java.lang.String newColumnType) |
protected void |
alterTableAddColumn(java.lang.String tableName,
java.lang.String columnName,
java.lang.String columnType) |
protected void |
alterTableDropColumn(java.lang.String tableName,
java.lang.String columnName) |
protected void |
alterTableName(java.lang.String tableName,
java.lang.String newTableName) |
protected boolean |
doHasTable(java.lang.String tableName)
Deprecated.
As of Cavanaugh (7.4.x), replaced by
hasTable(String) |
protected java.util.List<IndexMetadata> |
dropIndexes(java.lang.String tableName,
java.lang.String columnName) |
protected void |
dropTable(java.lang.String tableName) |
protected java.sql.Connection |
getConnection() |
protected java.lang.String[] |
getPrimaryKeyColumnNames(java.sql.Connection connection,
java.lang.String tableName) |
protected boolean |
hasColumn(java.lang.String tableName,
java.lang.String columnName) |
protected boolean |
hasColumnType(java.lang.String tableName,
java.lang.String columnName,
java.lang.String columnType) |
protected boolean |
hasIndex(java.lang.String tableName,
java.lang.String indexName) |
protected boolean |
hasRows(java.sql.Connection connection,
java.lang.String tableName) |
protected boolean |
hasRows(java.lang.String tableName) |
protected boolean |
hasTable(java.lang.String tableName) |
protected void |
process(com.liferay.petra.function.UnsafeConsumer<java.lang.Long,java.lang.Exception> unsafeConsumer) |
protected void |
processConcurrently(java.lang.String sql,
java.lang.String updateSQL,
com.liferay.petra.function.UnsafeFunction<java.sql.ResultSet,java.lang.Object[],java.lang.Exception> unsafeFunction,
com.liferay.petra.function.UnsafeBiConsumer<java.lang.Object[],java.sql.PreparedStatement,java.lang.Exception> unsafeBiConsumer,
java.lang.String exceptionMessage) |
protected void |
processConcurrently(java.lang.String sql,
com.liferay.petra.function.UnsafeFunction<java.sql.ResultSet,java.lang.Object[],java.lang.Exception> unsafeFunction,
com.liferay.petra.function.UnsafeConsumer<java.lang.Object[],java.lang.Exception> unsafeConsumer,
java.lang.String exceptionMessage) |
protected <T> void |
processConcurrently(T[] array,
com.liferay.petra.function.UnsafeConsumer<T,java.lang.Exception> unsafeConsumer,
java.lang.String exceptionMessage) |
protected void |
removePrimaryKey(java.lang.String tableName) |
void |
runSQL(java.sql.Connection connection,
java.lang.String template) |
void |
runSQL(DBTypeToSQLMap dbTypeToSQLMap) |
void |
runSQL(java.lang.String template) |
void |
runSQL(java.lang.String[] templates) |
void |
runSQLTemplate(java.lang.String path) |
void |
runSQLTemplate(java.lang.String path,
boolean failOnError) |
void |
runSQLTemplateString(java.lang.String template,
boolean failOnError) |
public void runSQL(java.sql.Connection connection, java.lang.String template) throws java.io.IOException, java.sql.SQLException
public void runSQL(DBTypeToSQLMap dbTypeToSQLMap) throws java.io.IOException, java.sql.SQLException
public void runSQL(java.lang.String template) throws java.io.IOException, java.sql.SQLException
public void runSQL(java.lang.String[] templates) throws java.io.IOException, java.sql.SQLException
public void runSQLTemplate(java.lang.String path) throws java.io.IOException, javax.naming.NamingException, java.sql.SQLException
runSQLTemplate
in interface DBProcess
java.io.IOException
javax.naming.NamingException
java.sql.SQLException
public void runSQLTemplate(java.lang.String path, boolean failOnError) throws java.io.IOException, javax.naming.NamingException, java.sql.SQLException
runSQLTemplate
in interface DBProcess
java.io.IOException
javax.naming.NamingException
java.sql.SQLException
public void runSQLTemplateString(java.lang.String template, boolean failOnError) throws java.io.IOException, javax.naming.NamingException, java.sql.SQLException
runSQLTemplateString
in interface DBProcess
java.io.IOException
javax.naming.NamingException
java.sql.SQLException
protected void addIndexes(java.sql.Connection connection, java.util.List<IndexMetadata> indexMetadatas) throws java.io.IOException, java.sql.SQLException
java.io.IOException
java.sql.SQLException
protected void alterColumnName(java.lang.String tableName, java.lang.String oldColumnName, java.lang.String newColumnDefinition) throws java.lang.Exception
java.lang.Exception
protected void alterColumnType(java.lang.String tableName, java.lang.String columnName, java.lang.String newColumnType) throws java.lang.Exception
java.lang.Exception
protected void alterTableAddColumn(java.lang.String tableName, java.lang.String columnName, java.lang.String columnType) throws java.lang.Exception
java.lang.Exception
protected void alterTableDropColumn(java.lang.String tableName, java.lang.String columnName) throws java.lang.Exception
java.lang.Exception
protected void alterTableName(java.lang.String tableName, java.lang.String newTableName) throws java.lang.Exception
java.lang.Exception
@Deprecated protected boolean doHasTable(java.lang.String tableName) throws java.lang.Exception
hasTable(String)
java.lang.Exception
protected java.util.List<IndexMetadata> dropIndexes(java.lang.String tableName, java.lang.String columnName) throws java.lang.Exception
java.lang.Exception
protected void dropTable(java.lang.String tableName) throws java.lang.Exception
java.lang.Exception
protected java.sql.Connection getConnection() throws java.lang.Exception
java.lang.Exception
protected java.lang.String[] getPrimaryKeyColumnNames(java.sql.Connection connection, java.lang.String tableName) throws java.sql.SQLException
java.sql.SQLException
protected boolean hasColumn(java.lang.String tableName, java.lang.String columnName) throws java.lang.Exception
java.lang.Exception
protected boolean hasColumnType(java.lang.String tableName, java.lang.String columnName, java.lang.String columnType) throws java.lang.Exception
java.lang.Exception
protected boolean hasIndex(java.lang.String tableName, java.lang.String indexName) throws java.lang.Exception
java.lang.Exception
protected boolean hasRows(java.sql.Connection connection, java.lang.String tableName)
protected boolean hasRows(java.lang.String tableName) throws java.lang.Exception
java.lang.Exception
protected boolean hasTable(java.lang.String tableName) throws java.lang.Exception
java.lang.Exception
protected void process(com.liferay.petra.function.UnsafeConsumer<java.lang.Long,java.lang.Exception> unsafeConsumer) throws java.lang.Exception
java.lang.Exception
protected void processConcurrently(java.lang.String sql, java.lang.String updateSQL, com.liferay.petra.function.UnsafeFunction<java.sql.ResultSet,java.lang.Object[],java.lang.Exception> unsafeFunction, com.liferay.petra.function.UnsafeBiConsumer<java.lang.Object[],java.sql.PreparedStatement,java.lang.Exception> unsafeBiConsumer, java.lang.String exceptionMessage) throws java.lang.Exception
java.lang.Exception
protected void processConcurrently(java.lang.String sql, com.liferay.petra.function.UnsafeFunction<java.sql.ResultSet,java.lang.Object[],java.lang.Exception> unsafeFunction, com.liferay.petra.function.UnsafeConsumer<java.lang.Object[],java.lang.Exception> unsafeConsumer, java.lang.String exceptionMessage) throws java.lang.Exception
java.lang.Exception
protected <T> void processConcurrently(T[] array, com.liferay.petra.function.UnsafeConsumer<T,java.lang.Exception> unsafeConsumer, java.lang.String exceptionMessage) throws java.lang.Exception
java.lang.Exception
protected void removePrimaryKey(java.lang.String tableName) throws java.lang.Exception
java.lang.Exception