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 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 void
alterTableName
(String tableName, String newTableName) protected boolean
doHasTable
(String tableName) Deprecated.protected List<IndexMetadata>
dropIndexes
(String tableName, String columnName) protected void
protected Connection
protected String[]
getPrimaryKeyColumnNames
(Connection connection, String tableName) protected boolean
protected boolean
hasColumnType
(String tableName, String columnName, String columnType) protected boolean
protected boolean
protected boolean
hasRows
(Connection connection, String tableName) protected boolean
protected boolean
protected void
protected void
processConcurrently
(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 void
processConcurrently
(String sql, com.liferay.petra.function.UnsafeFunction<ResultSet, Object[], Exception> unsafeFunction, com.liferay.petra.function.UnsafeConsumer<Object[], Exception> unsafeConsumer, String exceptionMessage) protected void
processConcurrently
(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> void
processConcurrently
(T[] array, com.liferay.petra.function.UnsafeConsumer<T, Exception> unsafeConsumer, String exceptionMessage) protected void
removePrimaryKey
(String tableName) void
runSQL
(DBTypeToSQLMap dbTypeToSQLMap) void
void
void
runSQL
(Connection connection, String template) void
runSQLFile
(String path) void
runSQLFile
(String path, boolean failOnError) void
runSQLTemplate
(String template, boolean failOnError) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
runSQL
in interfaceDBProcess
- Throws:
IOException
SQLException
-
runSQL
- Specified by:
runSQL
in interfaceDBProcess
- Throws:
IOException
SQLException
-
runSQL
- Specified by:
runSQL
in interfaceDBProcess
- Throws:
IOException
SQLException
-
runSQL
- Specified by:
runSQL
in interfaceDBProcess
- Throws:
IOException
SQLException
-
runSQLFile
- Specified by:
runSQLFile
in interfaceDBProcess
- Throws:
IOException
NamingException
SQLException
-
runSQLFile
public void runSQLFile(String path, boolean failOnError) throws IOException, NamingException, SQLException - Specified by:
runSQLFile
in interfaceDBProcess
- Throws:
IOException
NamingException
SQLException
-
runSQLTemplate
public void runSQLTemplate(String template, boolean failOnError) throws IOException, NamingException, SQLException - Specified by:
runSQLTemplate
in interfaceDBProcess
- Throws:
IOException
NamingException
SQLException
-
addIndexes
protected void addIndexes(Connection connection, List<IndexMetadata> indexMetadatas) throws IOException, SQLException - Throws:
IOException
SQLException
-
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)