Example usage for com.liferay.portal.kernel.dao.db DBType ORACLE

List of usage examples for com.liferay.portal.kernel.dao.db DBType ORACLE

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.db DBType ORACLE.

Prototype

DBType ORACLE

To view the source code for com.liferay.portal.kernel.dao.db DBType ORACLE.

Click Source Link

Usage

From source file:com.liferay.journal.verify.JournalServiceVerifyProcess.java

License:Open Source License

protected void verifyOracleNewLine() throws Exception {
    try (LoggingTimer loggingTimer = new LoggingTimer()) {
        DB db = DBManagerUtil.getDB();//  w  ww.j  a v  a  2s  .c  o m

        if (db.getDBType() != DBType.ORACLE) {
            return;
        }

        // This is a workaround for a limitation in Oracle sqlldr's
        // inability insert new line characters for long varchar columns.
        // See http://forums.liferay.com/index.php?showtopic=2761&hl=oracle
        // for more information. Check several articles because some
        // articles may not have new lines.

        boolean checkNewLine = false;

        List<JournalArticle> articles = _journalArticleLocalService.getArticles(DEFAULT_GROUP_ID, 0,
                NUM_OF_ARTICLES);

        for (JournalArticle article : articles) {
            String content = article.getContent();

            if ((content != null) && content.contains("\\n")) {
                articles = _journalArticleLocalService.getArticles(DEFAULT_GROUP_ID);

                for (int j = 0; j < articles.size(); j++) {
                    article = articles.get(j);

                    _journalArticleLocalService.checkNewLine(article.getGroupId(), article.getArticleId(),
                            article.getVersion());
                }

                checkNewLine = true;

                break;
            }
        }

        // Only process this once

        if (!checkNewLine) {
            if (_log.isInfoEnabled()) {
                _log.info("Do not fix oracle new line");
            }

            return;
        } else {
            if (_log.isInfoEnabled()) {
                _log.info("Fix oracle new line");
            }
        }
    }
}

From source file:it.dontesta.labs.liferay.portal.dao.db.OracleDB.java

License:Open Source License

public OracleDB(int majorVersion, int minorVersion) {
    super(DBType.ORACLE, majorVersion, minorVersion);
}