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 con,
String indexesSQL,
Set<String> validIndexNames) |
protected String |
applyMaxStringIndexLengthLimitation(Matcher matcher) |
protected String[] |
buildColumnNameTokens(String line) |
protected String[] |
buildColumnTypeTokens(String line) |
void |
buildCreateFile(String sqlDir,
String databaseName) |
void |
buildCreateFile(String sqlDir,
String databaseName,
int population) |
protected abstract String |
buildCreateFileContent(String sqlDir,
String databaseName,
int population) |
abstract String |
buildSQL(String template) |
void |
buildSQLFile(String sqlDir,
String fileName) |
protected String[] |
buildTableNameTokens(String line) |
protected String |
buildTemplate(String sqlDir,
String fileName) |
protected String |
convertTimestamp(String data) |
protected Set<String> |
dropIndexes(Connection con,
String tablesSQL,
String indexesSQL,
List<com.liferay.portal.kernel.dao.db.Index> indexes) |
protected String |
evaluateVM(String templateId,
String templateContent) |
protected String |
getCreateTablesContent(String sqlDir,
String suffix) |
com.liferay.portal.kernel.dao.db.DBType |
getDBType() |
List<com.liferay.portal.kernel.dao.db.Index> |
getIndexes(Connection con) |
int |
getMajorVersion() |
int |
getMinorVersion() |
protected abstract String |
getServerName() |
protected String |
getSuffix(int type) |
protected abstract String[] |
getTemplate() |
String |
getTemplateBlob() |
String |
getTemplateFalse() |
String |
getTemplateTrue() |
String |
getVersionString() |
protected void |
handleSQLException(String sql,
SQLException sqle) |
long |
increment() |
long |
increment(String name) |
long |
increment(String name,
int size) |
boolean |
isSupportsAlterColumnName() |
boolean |
isSupportsAlterColumnType() |
boolean |
isSupportsInlineDistinct() |
boolean |
isSupportsQueryingAfterException() |
boolean |
isSupportsScrollableResults() |
boolean |
isSupportsStringCaseSensitiveQuery() |
boolean |
isSupportsUpdateWithInnerJoin() |
protected String |
readFile(String fileName) |
protected String |
readSQL(String fileName,
String comments,
String eol) |
protected String |
removeBooleanIndexes(String sqlDir,
String data) |
protected String |
removeInserts(String data) |
protected String |
removeLongInserts(String data) |
protected String |
removeNull(String content) |
protected String |
replaceTemplate(String template,
String[] actual) |
protected abstract String |
reword(String data) |
void |
runSQL(Connection con,
String sql) |
void |
runSQL(Connection con,
String[] sqls) |
void |
runSQL(String sql) |
void |
runSQL(String[] sqls) |
void |
runSQLTemplate(String path) |
void |
runSQLTemplate(String path,
boolean failOnError) |
void |
runSQLTemplateString(Connection connection,
String template,
boolean evaluate,
boolean failOnError) |
void |
runSQLTemplateString(String template,
boolean evaluate,
boolean failOnError) |
void |
setSupportsStringCaseSensitiveQuery(boolean supportsStringCaseSensitiveQuery) |
void |
updateIndexes(Connection con,
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 con, String indexesSQL, Set<String> validIndexNames) throws IOException
addIndexes in interface com.liferay.portal.kernel.dao.db.DBIOExceptionpublic void buildCreateFile(String sqlDir, String databaseName) throws IOException
buildCreateFile in interface com.liferay.portal.kernel.dao.db.DBIOExceptionpublic void buildCreateFile(String sqlDir, String databaseName, int population) throws IOException
buildCreateFile in interface com.liferay.portal.kernel.dao.db.DBIOExceptionpublic abstract String buildSQL(String template) throws IOException
buildSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionpublic void buildSQLFile(String sqlDir, String fileName) throws IOException
buildSQLFile in interface com.liferay.portal.kernel.dao.db.DBIOExceptionpublic 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 con) throws SQLException
getIndexes 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 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 long increment()
increment in interface com.liferay.portal.kernel.dao.db.DBpublic long increment(String name)
increment in interface com.liferay.portal.kernel.dao.db.DBpublic long increment(String name, int size)
increment 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 runSQL(Connection con, String sql) throws IOException, SQLException
runSQL in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionpublic void runSQL(Connection con, 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 runSQLTemplate(String path) throws IOException, NamingException, SQLException
runSQLTemplate in interface com.liferay.portal.kernel.dao.db.DBIOExceptionNamingExceptionSQLExceptionpublic void runSQLTemplate(String path, boolean failOnError) throws IOException, NamingException, SQLException
runSQLTemplate in interface com.liferay.portal.kernel.dao.db.DBIOExceptionNamingExceptionSQLExceptionpublic void runSQLTemplateString(Connection connection, String template, boolean evaluate, boolean failOnError) throws IOException, NamingException, SQLException
runSQLTemplateString in interface com.liferay.portal.kernel.dao.db.DBIOExceptionNamingExceptionSQLExceptionpublic void runSQLTemplateString(String template, boolean evaluate, boolean failOnError) throws IOException, NamingException, SQLException
runSQLTemplateString in interface com.liferay.portal.kernel.dao.db.DBIOExceptionNamingExceptionSQLExceptionpublic void setSupportsStringCaseSensitiveQuery(boolean supportsStringCaseSensitiveQuery)
setSupportsStringCaseSensitiveQuery in interface com.liferay.portal.kernel.dao.db.DBpublic void updateIndexes(Connection con, String tablesSQL, String indexesSQL, boolean dropIndexes) throws IOException, SQLException
updateIndexes in interface com.liferay.portal.kernel.dao.db.DBIOExceptionSQLExceptionprotected String applyMaxStringIndexLengthLimitation(Matcher matcher)
protected abstract String buildCreateFileContent(String sqlDir, String databaseName, int population) throws IOException
IOExceptionprotected String buildTemplate(String sqlDir, String fileName) throws IOException
IOExceptionprotected Set<String> dropIndexes(Connection con, String tablesSQL, String indexesSQL, List<com.liferay.portal.kernel.dao.db.Index> indexes) throws IOException, SQLException
IOExceptionSQLExceptionprotected String evaluateVM(String templateId, String templateContent) throws Exception
Exceptionprotected String getCreateTablesContent(String sqlDir, String suffix) throws IOException
IOExceptionprotected abstract String getServerName()
protected String getSuffix(int type)
protected abstract String[] getTemplate()
protected void handleSQLException(String sql, SQLException sqle) throws SQLException
SQLExceptionprotected String readFile(String fileName) throws IOException
IOExceptionprotected String readSQL(String fileName, String comments, String eol) throws IOException
IOExceptionprotected String removeBooleanIndexes(String sqlDir, String data) throws IOException
IOExceptionprotected String removeInserts(String data) throws IOException
IOExceptionprotected String removeLongInserts(String data) throws IOException
IOExceptionprotected abstract String reword(String data) throws IOException
IOException