Search in sources :

Example 1 with DfTakeFinallyProcess

use of org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess in project dbflute-core by dbflute.

the class DfAlterCheckProcess method takeFinally.

// -----------------------------------------------------
// Take Finally
// ------------
protected void takeFinally(DfAlterCheckFinalInfo finalInfo) {
    // alter-take-finally.sql for assertion
    final String sqlRootDir = getMigrationAlterDirectory();
    final DfTakeFinallyProcess process = DfTakeFinallyProcess.createAsAlterSchema(sqlRootDir, _dataSource);
    final DfTakeFinallyFinalInfo takeFinally = process.execute();
    finalInfo.addAlterSqlFileAll(takeFinally.getTakeFinallySqlFileList());
    reflectTakeFinallyResultToFinalInfo(finalInfo, takeFinally);
}
Also used : DfTakeFinallyProcess(org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess) DfTakeFinallyFinalInfo(org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo)

Example 2 with DfTakeFinallyProcess

use of org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess in project dbflute-core by dbflute.

the class DfTakeAssertTask method doExecute.

// ===================================================================================
// Execute
// =======
@Override
protected void doExecute() {
    final String sqlRootDir = Srl.is_NotNull_and_NotTrimmedEmpty(_sqlRootDir) ? _sqlRootDir : "./playsql";
    final DfTakeFinallyProcess process = DfTakeFinallyProcess.createAsTakeAssert(sqlRootDir, getDataSource());
    _finalInfo = process.execute();
    final SQLFailureException breakCause = _finalInfo.getBreakCause();
    if (breakCause != null) {
        // high priority exception
        throw breakCause;
    }
    // get exceptions from this method when take-assert
    // (then the finalInfo does not have an exception)
    _takeAssertExList = process.getTakeAssertExList();
    handleSQLFailure();
    handleAssertionFailure(sqlRootDir);
}
Also used : DfTakeFinallyProcess(org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess) SQLFailureException(org.dbflute.exception.SQLFailureException)

Example 3 with DfTakeFinallyProcess

use of org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess in project dbflute-core by dbflute.

the class DfReplaceSchemaTask method takeFinally.

// -----------------------------------------------------
// Take Finally
// ------------
protected void takeFinally(String sqlRootDir, boolean previous) {
    final DfTakeFinallyProcess process = createTakeFinallyProcess(sqlRootDir, previous);
    _takeFinallyFinalInfo = process.execute();
    final SQLFailureException breakCause = _takeFinallyFinalInfo.getBreakCause();
    if (breakCause != null) {
        // high priority exception
        throw breakCause;
    }
    final DfTakeFinallyAssertionFailureException assertionEx = _takeFinallyFinalInfo.getAssertionEx();
    if (assertionEx != null) {
        // high priority exception
        throw assertionEx;
    }
}
Also used : DfTakeFinallyAssertionFailureException(org.dbflute.exception.DfTakeFinallyAssertionFailureException) DfTakeFinallyProcess(org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess) SQLFailureException(org.dbflute.exception.SQLFailureException)

Aggregations

DfTakeFinallyProcess (org.dbflute.logic.replaceschema.process.DfTakeFinallyProcess)3 SQLFailureException (org.dbflute.exception.SQLFailureException)2 DfTakeFinallyAssertionFailureException (org.dbflute.exception.DfTakeFinallyAssertionFailureException)1 DfTakeFinallyFinalInfo (org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo)1