public abstract class BaseDBProcess extends Object implements DBProcess
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
connection |
| Constructor and Description |
|---|
BaseDBProcess() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addIndexes(Connection connection,
List<IndexMetadata> indexMetadatas) |
protected void |
alterColumnName(String tableName,
String oldColumnName,
String newColumnDefinition) |
protected void |
alterColumnType(String tableName,
String columnName,
String newColumnType) |
protected void |
alterTableAddColumn(String tableName,
String columnName,
String columnType) |
protected void |
alterTableDropColumn(String tableName,
String columnName) |
protected boolean |
doHasTable(String tableName) |
protected List<IndexMetadata> |
dropIndexes(String tableName,
String columnName) |
protected String[] |
getPrimaryKeyColumnNames(Connection connection,
String tableName) |
protected boolean |
hasColumn(String tableName,
String columnName) |
protected boolean |
hasColumnType(String tableName,
String columnName,
String columnType) |
protected boolean |
hasIndex(String tableName,
String indexName) |
protected boolean |
hasRows(Connection connection,
String tableName) |
protected boolean |
hasRows(String tableName) |
protected boolean |
hasTable(String tableName) |
protected void |
process(com.liferay.petra.function.UnsafeConsumer<Long,Exception> unsafeConsumer) |
protected void |
processConcurrently(String sqlQuery,
com.liferay.petra.function.UnsafeFunction<ResultSet,Object[],Exception> unsafeFunction,
com.liferay.petra.function.UnsafeConsumer<Object[],Exception> unsafeConsumer,
String exceptionMessage) |
protected <T> void |
processConcurrently(T[] array,
com.liferay.petra.function.UnsafeConsumer<T,Exception> unsafeConsumer,
String exceptionMessage) |
protected void |
removePrimaryKey(String tableName) |
void |
runSQL(Connection connection,
String template) |
void |
runSQL(DBTypeToSQLMap dbTypeToSQLMap) |
void |
runSQL(String template) |
void |
runSQL(String[] templates) |
void |
runSQLTemplate(String path) |
void |
runSQLTemplate(String path,
boolean failOnError) |
void |
runSQLTemplateString(String template,
boolean failOnError) |
void |
runSQLTemplateString(String template,
boolean evaluate,
boolean failOnError)
Deprecated.
As of Athanasius (7.3.x), replaced by
runSQLTemplateString(String, boolean) |
public void runSQL(Connection connection,
String template)
throws IOException,
SQLException
public void runSQL(DBTypeToSQLMap dbTypeToSQLMap) throws IOException, SQLException
public void runSQL(String template)
throws IOException,
SQLException
public void runSQL(String[] templates)
throws IOException,
SQLException
public void runSQLTemplate(String path)
throws IOException,
javax.naming.NamingException,
SQLException
runSQLTemplate in interface DBProcessIOExceptionjavax.naming.NamingExceptionSQLExceptionpublic void runSQLTemplate(String path,
boolean failOnError)
throws IOException,
javax.naming.NamingException,
SQLException
runSQLTemplate in interface DBProcessIOExceptionjavax.naming.NamingExceptionSQLExceptionpublic void runSQLTemplateString(String template,
boolean failOnError)
throws IOException,
javax.naming.NamingException,
SQLException
runSQLTemplateString in interface DBProcessIOExceptionjavax.naming.NamingExceptionSQLException@Deprecated
public void runSQLTemplateString(String template,
boolean evaluate,
boolean failOnError)
throws IOException,
javax.naming.NamingException,
SQLException
runSQLTemplateString(String, boolean)runSQLTemplateString in interface DBProcessIOExceptionjavax.naming.NamingExceptionSQLExceptionprotected void addIndexes(Connection connection,
List<IndexMetadata> indexMetadatas)
throws IOException,
SQLException
IOExceptionSQLExceptionprotected void alterColumnName(String tableName,
String oldColumnName,
String newColumnDefinition)
throws Exception
Exceptionprotected void alterColumnType(String tableName,
String columnName,
String newColumnType)
throws Exception
Exceptionprotected void alterTableAddColumn(String tableName,
String columnName,
String columnType)
throws Exception
Exceptionprotected void alterTableDropColumn(String tableName,
String columnName)
throws Exception
Exceptionprotected boolean doHasTable(String tableName)
throws Exception
Exceptionprotected List<IndexMetadata> dropIndexes(String tableName, String columnName) throws Exception
Exceptionprotected String[] getPrimaryKeyColumnNames(Connection connection,
String tableName)
throws SQLException
SQLExceptionprotected boolean hasColumn(String tableName,
String columnName)
throws Exception
Exceptionprotected boolean hasColumnType(String tableName,
String columnName,
String columnType)
throws Exception
Exceptionprotected boolean hasIndex(String tableName,
String indexName)
throws Exception
Exceptionprotected boolean hasRows(Connection connection,
String tableName)
protected boolean hasRows(String tableName)
throws Exception
Exceptionprotected boolean hasTable(String tableName)
throws Exception
Exceptionprotected void process(com.liferay.petra.function.UnsafeConsumer<Long,Exception> unsafeConsumer)
throws Exception
Exceptionprotected void processConcurrently(String sqlQuery,
com.liferay.petra.function.UnsafeFunction<ResultSet,Object[],Exception> unsafeFunction,
com.liferay.petra.function.UnsafeConsumer<Object[],Exception> unsafeConsumer,
String exceptionMessage)
throws Exception
Exceptionprotected <T> void processConcurrently(T[] array,
com.liferay.petra.function.UnsafeConsumer<T,Exception> unsafeConsumer,
String exceptionMessage)
throws Exception
Exceptionprotected void removePrimaryKey(String tableName)
throws Exception
Exception