Package com.liferay.portal.kernel.dao.db
Interface DB
@ProviderType
public interface DB
- Author:
- Brian Wing Shun Chan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIndexes
(Connection connection, List<IndexMetadata> indexMetadatas) void
alterColumnName
(Connection connection, String tableName, String oldColumnName, String newColumnDefinition) void
alterColumnType
(Connection connection, String tableName, String columnName, String newColumnType) void
alterTableAddColumn
(Connection connection, String tableName, String columnName, String columnType) void
alterTableDropColumn
(Connection connection, String tableName, String columnName) void
copyTableRows
(Connection connection, String sourceTableName, String targetTableName, Map<String, String> columnNamesMap, Map<String, String> defaultValuesMap) void
copyTableStructure
(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) int
int
default String
getPopulateSQL
(String databaseName, String sqlContent) String[]
getPrimaryKeyColumnNames
(Connection connection, String tableName) getRecreateSQL
(String databaseName) getSQLType
(String templateType) getSQLTypeDecimalDigits
(String templateType) getSQLTypeSize
(String templateType) boolean
boolean
boolean
boolean
default boolean
boolean
boolean
boolean
boolean
void
void
removePrimaryKey
(Connection connection, String tableName) void
renameTables
(Connection connection, ObjectValuePair<String, String>... tableNameObjectValuePairs) default void
runSQL
(DBTypeToSQLMap dbTypeToSQLMap) void
void
default void
runSQL
(Connection connection, DBTypeToSQLMap dbTypeToSQLMap) void
runSQL
(Connection connection, String sql) void
runSQL
(Connection connection, String[] sqls) void
runSQLTemplate
(String template, boolean failOnError) void
runSQLTemplate
(Connection connection, String template, boolean failOnError) default void
runSQLTemplateString
(String template, boolean failOnError) Deprecated.default void
runSQLTemplateString
(Connection connection, String template, boolean failOnError) Deprecated.As of Cavanaugh (7.4.x), replaced byrunSQLTemplate(Connection, String, boolean)
void
setSupportsStringCaseSensitiveQuery
(boolean supportsStringCaseSensitiveQuery) syncTables
(Connection connection, String sourceTableName, String targetTableName, Map<String, String> columnNamesMap, Map<String, String> defaultValuesMap) void
updateIndexes
(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:
IOException
SQLException
-
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:
IOException
SQLException
-
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:
IOException
SQLException
-
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:
IOException
SQLException
-
runSQL
- Throws:
IOException
SQLException
-
runSQL
- Throws:
IOException
SQLException
-
runSQL
- Throws:
IOException
SQLException
-
runSQL
- Throws:
IOException
SQLException
-
runSQL
- Throws:
IOException
SQLException
-
runSQLTemplate
void runSQLTemplate(Connection connection, String template, boolean failOnError) throws IOException, NamingException, SQLException - Throws:
IOException
NamingException
SQLException
-
runSQLTemplate
void runSQLTemplate(String template, boolean failOnError) throws IOException, NamingException, SQLException - Throws:
IOException
NamingException
SQLException
-
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:
IOException
NamingException
SQLException
-
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:
IOException
NamingException
SQLException
-
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)