public abstract class BaseDB
extends Object
implements com.liferay.portal.kernel.dao.db.DB
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ALTER_COLUMN_NAME |
protected static String |
ALTER_COLUMN_TYPE |
protected static String |
ALTER_TABLE_NAME |
protected static String |
CREATE_TABLE |
protected static String |
DROP_INDEX |
protected static String |
DROP_PRIMARY_KEY |
protected static String[] |
RENAME_TABLE_TEMPLATE |
protected static String[] |
REWORD_TEMPLATE |
protected static String[] |
TEMPLATE |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseDB(com.liferay.portal.kernel.dao.db.DBType dbType,
int majorVersion,
int minorVersion) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexes(Connection connection,
String indexesSQL,
Set<String> validIndexNames) |
protected String[] |
buildColumnNameTokens(String line) |
protected String[] |
buildColumnTypeTokens(String line) |
abstract String |
buildSQL(String template) |
protected String[] |
buildTableNameTokens(String line) |
protected Set<String> |
dropIndexes(Connection connection,
String tablesSQL,
String indexesSQL,
List<com.liferay.portal.kernel.dao.db.Index> indexes) |
com.liferay.portal.kernel.dao.db.DBType |
getDBType() |
List<com.liferay.portal.kernel.dao.db.Index> |
getIndexes(Connection connection) |
ResultSet |
getIndexResultSet(Connection connection,
String tableName) |
int |
getMajorVersion() |
int |
getMinorVersion() |
ResultSet |
getPrimaryKeysResultSet(Connection connection,
String tableName) |
Integer |
getSQLType(String templateType) |
protected abstract int[] |
getSQLTypes() |
Integer |
getSQLVarcharSize(String templateType) |
protected int[] |
getSQLVarcharSizes() |
protected abstract String[] |
getTemplate() |
String |
getTemplateBlob() |
String |
getTemplateFalse() |
String |
getTemplateTrue() |
String |
getVersionString() |
boolean |
isSupportsAlterColumnName() |
boolean |
isSupportsAlterColumnType() |
boolean |
isSupportsInlineDistinct() |
boolean |
isSupportsQueryingAfterException() |
boolean |
isSupportsScrollableResults() |
boolean |
isSupportsStringCaseSensitiveQuery() |
boolean |
isSupportsUpdateWithInnerJoin() |
protected String |
limitColumnLength(String column,
int length) |
void |
process(com.liferay.petra.function.UnsafeConsumer<Long,Exception> unsafeConsumer) |
protected String |
replaceTemplate(String template) |
protected abstract String |
reword(String data) |
void |
runSQL(Connection connection,
String sql) |
void |
runSQL(Connection connection,
String[] sqls) |
void |
runSQL(String sql) |
void |
runSQL(String[] sqls) |
void |
runSQLTemplateString(Connection connection,
String template,
boolean failOnError) |
void |
runSQLTemplateString(String template,
boolean failOnError) |
void |
setSupportsStringCaseSensitiveQuery(boolean supportsStringCaseSensitiveQuery) |
void |
updateIndexes(Connection connection,
String tablesSQL,
String indexesSQL,
boolean dropIndexes) |
protected static final String ALTER_COLUMN_NAME
protected static final String ALTER_COLUMN_TYPE
protected static final String ALTER_TABLE_NAME
protected static final String CREATE_TABLE
protected static final String DROP_INDEX
protected static final String DROP_PRIMARY_KEY
protected static final String[] RENAME_TABLE_TEMPLATE
protected static final String[] REWORD_TEMPLATE
protected static final String[] TEMPLATE
protected BaseDB(com.liferay.portal.kernel.dao.db.DBType dbType,
int majorVersion,
int minorVersion)
public void addIndexes(Connection connection,
String indexesSQL,
Set<String> validIndexNames)
throws IOException
addIndexes in interface com.liferay.portal.kernel.dao.db.DBIOExceptionpublic abstract String buildSQL(String template)
throws IOException,
SQLException
buildSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionpublic com.liferay.portal.kernel.dao.db.DBType getDBType()
getDBType in interface com.liferay.portal.kernel.dao.db.DBpublic List<com.liferay.portal.kernel.dao.db.Index> getIndexes(Connection connection)
throws SQLException
getIndexes in interface com.liferay.portal.kernel.dao.db.DBSQLExceptionpublic ResultSet getIndexResultSet(Connection connection,
String tableName)
throws SQLException
getIndexResultSet in interface com.liferay.portal.kernel.dao.db.DBSQLExceptionpublic int getMajorVersion()
getMajorVersion in interface com.liferay.portal.kernel.dao.db.DBpublic int getMinorVersion()
getMinorVersion in interface com.liferay.portal.kernel.dao.db.DBpublic ResultSet getPrimaryKeysResultSet(Connection connection,
String tableName)
throws SQLException
getPrimaryKeysResultSet in interface com.liferay.portal.kernel.dao.db.DBSQLExceptionpublic Integer getSQLType(String templateType)
getSQLType in interface com.liferay.portal.kernel.dao.db.DBpublic Integer getSQLVarcharSize(String templateType)
getSQLVarcharSize in interface com.liferay.portal.kernel.dao.db.DBpublic String getTemplateBlob()
getTemplateBlob in interface com.liferay.portal.kernel.dao.db.DBpublic String getTemplateFalse()
getTemplateFalse in interface com.liferay.portal.kernel.dao.db.DBpublic String getTemplateTrue()
getTemplateTrue in interface com.liferay.portal.kernel.dao.db.DBpublic String getVersionString()
getVersionString in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsAlterColumnName()
isSupportsAlterColumnName in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsAlterColumnType()
isSupportsAlterColumnType in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsInlineDistinct()
isSupportsInlineDistinct in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsQueryingAfterException()
isSupportsQueryingAfterException in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsScrollableResults()
isSupportsScrollableResults in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsStringCaseSensitiveQuery()
isSupportsStringCaseSensitiveQuery in interface com.liferay.portal.kernel.dao.db.DBpublic boolean isSupportsUpdateWithInnerJoin()
isSupportsUpdateWithInnerJoin in interface com.liferay.portal.kernel.dao.db.DBpublic void process(com.liferay.petra.function.UnsafeConsumer<Long,Exception> unsafeConsumer)
throws Exception
process in interface com.liferay.portal.kernel.dao.db.DBExceptionpublic void runSQL(Connection connection,
String sql)
throws IOException,
SQLException
runSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionpublic void runSQL(Connection connection,
String[] sqls)
throws IOException,
SQLException
runSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionpublic void runSQL(String sql)
throws IOException,
SQLException
runSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionpublic void runSQL(String[] sqls)
throws IOException,
SQLException
runSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionpublic void runSQLTemplateString(Connection connection,
String template,
boolean failOnError)
throws IOException,
javax.naming.NamingException,
SQLException
runSQLTemplateString in interface com.liferay.portal.kernel.dao.db.DBIOExceptionjavax.naming.NamingExceptionSQLExceptionpublic void runSQLTemplateString(String template,
boolean failOnError)
throws IOException,
javax.naming.NamingException,
SQLException
runSQLTemplateString in interface com.liferay.portal.kernel.dao.db.DBIOExceptionjavax.naming.NamingExceptionSQLExceptionpublic void setSupportsStringCaseSensitiveQuery(boolean supportsStringCaseSensitiveQuery)
setSupportsStringCaseSensitiveQuery in interface com.liferay.portal.kernel.dao.db.DBpublic void updateIndexes(Connection connection,
String tablesSQL,
String indexesSQL,
boolean dropIndexes)
throws Exception
updateIndexes in interface com.liferay.portal.kernel.dao.db.DBExceptionprotected String[] buildColumnNameTokens(String line)
protected String[] buildColumnTypeTokens(String line)
protected String[] buildTableNameTokens(String line)
protected Set<String> dropIndexes(Connection connection,
String tablesSQL,
String indexesSQL,
List<com.liferay.portal.kernel.dao.db.Index> indexes)
throws IOException,
SQLException
IOExceptionSQLExceptionprotected abstract int[] getSQLTypes()
protected int[] getSQLVarcharSizes()
protected abstract String[] getTemplate()
protected String limitColumnLength(String column,
int length)
protected String replaceTemplate(String template)
protected abstract String reword(String data)
throws IOException,
SQLException
IOExceptionSQLException