Package com.liferay.portal.kernel.dao.db
Interface DB
@ProviderType
public interface DB
- Author:
- Brian Wing Shun Chan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndexes(Connection connection, List<IndexMetadata> indexMetadatas) voidalterColumnName(Connection connection, String tableName, String oldColumnName, String newColumnDefinition) voidalterColumnType(Connection connection, String tableName, String columnName, String newColumnType) voidalterTableAddColumn(Connection connection, String tableName, String columnName, String columnType) voidalterTableDropColumn(Connection connection, String tableName, String columnName) voidcopyTableRows(Connection connection, String sourceTableName, String targetTableName, Map<String, String> columnNamesMap, Map<String, String> defaultValuesMap) voidcopyTableStructure(Connection connection, String tableName, String newTableName) dropIndexes(Connection connection, String tableName, String columnName) getDefaultValue(String columnDef) getIndexes(Connection connection) getIndexMetadatas(Connection connection, String tableName, String columnName, boolean onlyUnique) getIndexResultSet(Connection connection, String tableName, boolean onlyUnique) intintdefault StringgetPopulateSQL(String databaseName, String sqlContent) String[]getPrimaryKeyColumnNames(Connection connection, String tableName) getRecreateSQL(String databaseName) getSQLType(String templateType) getSQLTypeDecimalDigits(String templateType) getSQLTypeSize(String templateType) booleanbooleanbooleanbooleandefault booleanbooleanbooleanbooleanbooleanvoidvoidremovePrimaryKey(Connection connection, String tableName) voidrenameTables(Connection connection, ObjectValuePair<String, String>... tableNameObjectValuePairs) default voidrunSQL(DBTypeToSQLMap dbTypeToSQLMap) voidvoiddefault voidrunSQL(Connection connection, DBTypeToSQLMap dbTypeToSQLMap) voidrunSQL(Connection connection, String sql) voidrunSQL(Connection connection, String[] sqls) voidrunSQLTemplate(String template, boolean failOnError) voidrunSQLTemplate(Connection connection, String template, boolean failOnError) default voidrunSQLTemplateString(String template, boolean failOnError) Deprecated.default voidrunSQLTemplateString(Connection connection, String template, boolean failOnError) Deprecated.As of Cavanaugh (7.4.x), replaced byrunSQLTemplate(Connection, String, boolean)voidsetSupportsStringCaseSensitiveQuery(boolean supportsStringCaseSensitiveQuery) syncTables(Connection connection, String sourceTableName, String targetTableName, Map<String, String> columnNamesMap, Map<String, String> defaultValuesMap) voidupdateIndexes(Connection connection, String tableName, String indexesSQL, boolean dropStaleIndexes)
-
Field Details
-
SQL_SIZE_NONE
static final int SQL_SIZE_NONE- See Also:
-
SQL_VARCHAR_MAX_SIZE
static final int SQL_VARCHAR_MAX_SIZE- See Also:
-
SQL_VARCHAR_MAX_SIZE_THRESHOLD
static final int SQL_VARCHAR_MAX_SIZE_THRESHOLD- See Also:
-
-
Method Details
-
addIndexes
void addIndexes(Connection connection, List<IndexMetadata> indexMetadatas) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
alterColumnName
void alterColumnName(Connection connection, String tableName, String oldColumnName, String newColumnDefinition) throws Exception - Throws:
Exception
-
alterColumnType
void alterColumnType(Connection connection, String tableName, String columnName, String newColumnType) throws Exception - Throws:
Exception
-
alterTableAddColumn
void alterTableAddColumn(Connection connection, String tableName, String columnName, String columnType) throws Exception - Throws:
Exception
-
alterTableDropColumn
void alterTableDropColumn(Connection connection, String tableName, String columnName) throws Exception - Throws:
Exception
-
buildSQL
- Throws:
IOExceptionSQLException
-
copyTableRows
void copyTableRows(Connection connection, String sourceTableName, String targetTableName, Map<String, String> columnNamesMap, Map<String, throws ExceptionString> defaultValuesMap) - Throws:
Exception
-
copyTableStructure
void copyTableStructure(Connection connection, String tableName, String newTableName) throws Exception - Throws:
Exception
-
dropIndexes
List<IndexMetadata> dropIndexes(Connection connection, String tableName, String columnName) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getDBType
DBType getDBType() -
getDefaultValue
-
getIndexes
- Throws:
SQLException
-
getIndexMetadatas
List<IndexMetadata> getIndexMetadatas(Connection connection, String tableName, String columnName, boolean onlyUnique) throws SQLException - Throws:
SQLException
-
getIndexResultSet
ResultSet getIndexResultSet(Connection connection, String tableName, boolean onlyUnique) throws SQLException - Throws:
SQLException
-
getMajorVersion
int getMajorVersion() -
getMinorVersion
int getMinorVersion() -
getNewUuidFunctionName
-
getPopulateSQL
-
getPrimaryKeyColumnNames
- Throws:
SQLException
-
getRecreateSQL
-
getSQLType
-
getSQLTypeDecimalDigits
-
getSQLTypeSize
-
getTemplateBlob
String getTemplateBlob() -
getTemplateFalse
String getTemplateFalse() -
getTemplateTrue
String getTemplateTrue() -
getVersionString
String getVersionString() -
isSupportsAlterColumnName
boolean isSupportsAlterColumnName() -
isSupportsAlterColumnType
boolean isSupportsAlterColumnType() -
isSupportsDBPartition
boolean isSupportsDBPartition() -
isSupportsInlineDistinct
boolean isSupportsInlineDistinct() -
isSupportsNewUuidFunction
default boolean isSupportsNewUuidFunction() -
isSupportsQueryingAfterException
boolean isSupportsQueryingAfterException() -
isSupportsScrollableResults
boolean isSupportsScrollableResults() -
isSupportsStringCaseSensitiveQuery
boolean isSupportsStringCaseSensitiveQuery() -
isSupportsUpdateWithInnerJoin
boolean isSupportsUpdateWithInnerJoin() -
process
void process(com.liferay.petra.function.UnsafeConsumer<Long, Exception> unsafeConsumer) throws Exception- Throws:
Exception
-
removePrimaryKey
- Throws:
Exception
-
renameTables
void renameTables(Connection connection, ObjectValuePair<String, String>... tableNameObjectValuePairs) throws Exception- Throws:
Exception
-
runSQL
default void runSQL(Connection connection, DBTypeToSQLMap dbTypeToSQLMap) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
runSQL
- Throws:
IOExceptionSQLException
-
runSQL
- Throws:
IOExceptionSQLException
-
runSQL
- Throws:
IOExceptionSQLException
-
runSQL
- Throws:
IOExceptionSQLException
-
runSQL
- Throws:
IOExceptionSQLException
-
runSQLTemplate
void runSQLTemplate(Connection connection, String template, boolean failOnError) throws IOException, NamingException, SQLException - Throws:
IOExceptionNamingExceptionSQLException
-
runSQLTemplate
void runSQLTemplate(String template, boolean failOnError) throws IOException, NamingException, SQLException - Throws:
IOExceptionNamingExceptionSQLException
-
runSQLTemplateString
@Deprecated default void runSQLTemplateString(Connection connection, String template, boolean failOnError) throws IOException, NamingException, SQLException Deprecated.As of Cavanaugh (7.4.x), replaced byrunSQLTemplate(Connection, String, boolean)- Throws:
IOExceptionNamingExceptionSQLException
-
runSQLTemplateString
@Deprecated default void runSQLTemplateString(String template, boolean failOnError) throws IOException, NamingException, SQLException Deprecated.As of Cavanaugh (7.4.x), replaced byrunSQLTemplate(String, boolean)- Throws:
IOExceptionNamingExceptionSQLException
-
setSupportsStringCaseSensitiveQuery
void setSupportsStringCaseSensitiveQuery(boolean supportsStringCaseSensitiveQuery) -
syncTables
AutoCloseable syncTables(Connection connection, String sourceTableName, String targetTableName, Map<String, String> columnNamesMap, Map<String, throws ExceptionString> defaultValuesMap) - Throws:
Exception
-
updateIndexes
void updateIndexes(Connection connection, String tableName, String indexesSQL, boolean dropStaleIndexes) throws Exception - Throws:
Exception
-
runSQLTemplate(String, boolean)