Package com.liferay.portal.kernel.dao.db
Class BaseDBProcess
Object
com.liferay.portal.kernel.dao.db.BaseDBProcess
- All Implemented Interfaces:
DBProcess
- Direct Known Subclasses:
UpgradeProcess
- Author:
- Hugo Huijser, Brian Wing Shun Chan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIndexes(Connection connection, List<IndexMetadata> indexMetadatas) protected voidalterColumnName(String tableName, String oldColumnName, String newColumnDefinition) protected voidalterColumnType(String tableName, String columnName, String newColumnType) protected voidalterTableAddColumn(String tableName, String columnName, String columnType) protected voidalterTableDropColumn(String tableName, String columnName) protected voidalterTableName(String tableName, String newTableName) protected booleandoHasTable(String tableName) Deprecated.protected List<IndexMetadata>dropIndexes(String tableName, String columnName) protected voidprotected Connectionprotected String[]getPrimaryKeyColumnNames(Connection connection, String tableName) protected booleanprotected booleanhasColumnType(String tableName, String columnName, String columnType) protected booleanprotected booleanprotected booleanhasRows(Connection connection, String tableName) protected booleanprotected booleanprotected voidprotected voidprocessConcurrently(String sql, com.liferay.petra.function.UnsafeConsumer<PreparedStatement, Exception> unsafeConsumer, String updateSQL, com.liferay.petra.function.UnsafeFunction<ResultSet, Object[], Exception> unsafeFunction, com.liferay.petra.function.UnsafeBiConsumer<Object[], PreparedStatement, Exception> unsafeBiConsumer, String exceptionMessage) protected voidprocessConcurrently(String sql, com.liferay.petra.function.UnsafeFunction<ResultSet, Object[], Exception> unsafeFunction, com.liferay.petra.function.UnsafeConsumer<Object[], Exception> unsafeConsumer, String exceptionMessage) protected voidprocessConcurrently(String sql, String updateSQL, com.liferay.petra.function.UnsafeFunction<ResultSet, Object[], Exception> unsafeFunction, com.liferay.petra.function.UnsafeBiConsumer<Object[], PreparedStatement, Exception> unsafeBiConsumer, String exceptionMessage) protected <T> voidprocessConcurrently(T[] array, com.liferay.petra.function.UnsafeConsumer<T, Exception> unsafeConsumer, String exceptionMessage) protected voidremovePrimaryKey(String tableName) voidrunSQL(DBTypeToSQLMap dbTypeToSQLMap) voidvoidvoidrunSQL(Connection connection, String template) voidrunSQLFile(String path) voidrunSQLFile(String path, boolean failOnError) voidrunSQLTemplate(String template, boolean failOnError) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.portal.kernel.dao.db.DBProcess
runSQLTemplate, runSQLTemplateString
-
Field Details
-
connection
-
-
Constructor Details
-
BaseDBProcess
public BaseDBProcess()
-
-
Method Details
-
runSQL
- Specified by:
runSQLin interfaceDBProcess- Throws:
IOExceptionSQLException
-
runSQL
- Specified by:
runSQLin interfaceDBProcess- Throws:
IOExceptionSQLException
-
runSQL
- Specified by:
runSQLin interfaceDBProcess- Throws:
IOExceptionSQLException
-
runSQL
- Specified by:
runSQLin interfaceDBProcess- Throws:
IOExceptionSQLException
-
runSQLFile
- Specified by:
runSQLFilein interfaceDBProcess- Throws:
IOExceptionNamingExceptionSQLException
-
runSQLFile
public void runSQLFile(String path, boolean failOnError) throws IOException, NamingException, SQLException - Specified by:
runSQLFilein interfaceDBProcess- Throws:
IOExceptionNamingExceptionSQLException
-
runSQLTemplate
public void runSQLTemplate(String template, boolean failOnError) throws IOException, NamingException, SQLException - Specified by:
runSQLTemplatein interfaceDBProcess- Throws:
IOExceptionNamingExceptionSQLException
-
addIndexes
protected void addIndexes(Connection connection, List<IndexMetadata> indexMetadatas) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
alterColumnName
protected void alterColumnName(String tableName, String oldColumnName, String newColumnDefinition) throws Exception - Throws:
Exception
-
alterColumnType
protected void alterColumnType(String tableName, String columnName, String newColumnType) throws Exception - Throws:
Exception
-
alterTableAddColumn
protected void alterTableAddColumn(String tableName, String columnName, String columnType) throws Exception - Throws:
Exception
-
alterTableDropColumn
- Throws:
Exception
-
alterTableName
- Throws:
Exception
-
doHasTable
Deprecated.As of Cavanaugh (7.4.x), replaced byhasTable(String)- Throws:
Exception
-
dropIndexes
- Throws:
Exception
-
dropTable
- Throws:
Exception
-
getConnection
- Throws:
Exception
-
getPrimaryKeyColumnNames
protected String[] getPrimaryKeyColumnNames(Connection connection, String tableName) throws SQLException - Throws:
SQLException
-
hasColumn
- Throws:
Exception
-
hasColumnType
protected boolean hasColumnType(String tableName, String columnName, String columnType) throws Exception - Throws:
Exception
-
hasIndex
- Throws:
Exception
-
hasRows
-
hasRows
- Throws:
Exception
-
hasTable
- Throws:
Exception
-
hasView
- Throws:
Exception
-
process
protected void process(com.liferay.petra.function.UnsafeConsumer<Long, Exception> unsafeConsumer) throws Exception- Throws:
Exception
-
processConcurrently
protected void processConcurrently(String sql, String updateSQL, com.liferay.petra.function.UnsafeFunction<ResultSet, Object[], throws ExceptionException> unsafeFunction, com.liferay.petra.function.UnsafeBiConsumer<Object[], PreparedStatement, Exception> unsafeBiConsumer, String exceptionMessage) - Throws:
Exception
-
processConcurrently
protected void processConcurrently(String sql, com.liferay.petra.function.UnsafeConsumer<PreparedStatement, Exception> unsafeConsumer, String updateSQL, com.liferay.petra.function.UnsafeFunction<ResultSet, throws ExceptionObject[], Exception> unsafeFunction, com.liferay.petra.function.UnsafeBiConsumer<Object[], PreparedStatement, Exception> unsafeBiConsumer, String exceptionMessage) - Throws:
Exception
-
processConcurrently
protected void processConcurrently(String sql, com.liferay.petra.function.UnsafeFunction<ResultSet, Object[], throws ExceptionException> unsafeFunction, com.liferay.petra.function.UnsafeConsumer<Object[], Exception> unsafeConsumer, String exceptionMessage) - Throws:
Exception
-
processConcurrently
protected <T> void processConcurrently(T[] array, com.liferay.petra.function.UnsafeConsumer<T, Exception> unsafeConsumer, String exceptionMessage) throws Exception- Throws:
Exception
-
removePrimaryKey
- Throws:
Exception
-
hasTable(String)