Search in sources :

Example 1 with LineToken

use of org.dbflute.helper.token.line.LineToken in project dbflute-core by dbflute.

the class DfAbstractReplaceSchemaProcess method extractDetailMessageList.

// ===================================================================================
//     Final Info
// ==========
protected List<String> extractDetailMessageList(DfSqlFileFireResult fireResult) {
    final List<String> detailMessageList = new ArrayList<String>();
    final String detailMessage = fireResult.getDetailMessage();
    if (detailMessage != null && detailMessage.trim().length() > 0) {
        final LineToken lineToken = new LineToken();
        final List<String> tokenizedList = lineToken.tokenize(detailMessage, op -> op.delimitateBy(ln()));
        for (String tokenizedElement : tokenizedList) {
            detailMessageList.add(tokenizedElement);
        }
    }
    return detailMessageList;
}
Also used : LineToken(org.dbflute.helper.token.line.LineToken) ArrayList(java.util.ArrayList)

Example 2 with LineToken

use of org.dbflute.helper.token.line.LineToken in project dbflute-core by dbflute.

the class DfAbstractRepsProcess method extractDetailMessageList.

// ===================================================================================
//     Final Info
// ==========
protected List<String> extractDetailMessageList(DfSqlFileFireResult fireResult) {
    final List<String> detailMessageList = new ArrayList<String>();
    final String detailMessage = fireResult.getDetailMessage();
    if (detailMessage != null && detailMessage.trim().length() > 0) {
        final LineToken lineToken = new LineToken();
        final List<String> tokenizedList = lineToken.tokenize(detailMessage, op -> op.delimitateBy(ln()));
        for (String tokenizedElement : tokenizedList) {
            detailMessageList.add(tokenizedElement);
        }
    }
    return detailMessageList;
}
Also used : LineToken(org.dbflute.helper.token.line.LineToken) ArrayList(java.util.ArrayList)

Example 3 with LineToken

use of org.dbflute.helper.token.line.LineToken in project dbflute-core by dbflute.

the class DfSqlFileFireMan method doBuildErrorContinuedMessage.

protected void doBuildErrorContinuedMessage(StringBuilder sb, List<ErrorContinuedSql> errorContinuedSqlList) {
    for (ErrorContinuedSql errorContinuedSql : errorContinuedSqlList) {
        final String sql = errorContinuedSql.getSql();
        sb.append(ln()).append(sql);
        final SQLException sqlEx = errorContinuedSql.getSqlEx();
        String message = sqlEx.getMessage();
        if (sqlEx != null && message != null) {
            message = message.trim();
            final LineToken lineToken = new LineToken();
            final List<String> tokenizedList = lineToken.tokenize(message, op -> op.delimitateBy(ln()));
            int elementIndex = 0;
            for (String element : tokenizedList) {
                if (elementIndex == 0) {
                    sb.append(ln()).append(" >> ").append(element);
                } else {
                    sb.append(ln()).append("    ").append(element);
                }
                ++elementIndex;
            }
            if (isShowSQLState(sqlEx)) {
                sb.append(ln());
                sb.append("    (SQLState=").append(sqlEx.getSQLState());
                sb.append(" ErrorCode=").append(sqlEx.getErrorCode()).append(")");
            }
        }
    }
}
Also used : LineToken(org.dbflute.helper.token.line.LineToken) ErrorContinuedSql(org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunnerResult.ErrorContinuedSql) SQLException(java.sql.SQLException) DfFireSqlScriptSQLException(org.dbflute.exception.DfFireSqlScriptSQLException)

Aggregations

LineToken (org.dbflute.helper.token.line.LineToken)3 ArrayList (java.util.ArrayList)2 SQLException (java.sql.SQLException)1 DfFireSqlScriptSQLException (org.dbflute.exception.DfFireSqlScriptSQLException)1 ErrorContinuedSql (org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunnerResult.ErrorContinuedSql)1