Search in sources :

Example 6 with DfSqlFileFireMan

use of org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan in project dbflute-core by dbflute.

the class DfTakeFinallyProcess method createSqlFileFireMan.

protected DfSqlFileFireMan createSqlFileFireMan() {
    // similar to alter check
    final String[] scriptExtAry = SystemScript.getSupportedExtList().toArray(new String[] {});
    final SystemScript script = new SystemScript();
    final DfSqlFileFireMan fireMan = new DfSqlFileFireMan() {

        @Override
        protected DfSqlFileRunnerResult processSqlFile(DfSqlFileRunner runner, File sqlFile) {
            _executedSqlFileList.add(sqlFile);
            if (isScriptFile(sqlFile, scriptExtAry)) {
                return processScriptFile(runner, script, sqlFile);
            } else {
                // mainly here
                return super.processSqlFile(runner, sqlFile);
            }
        }
    };
    fireMan.setExecutorName("Take Finally");
    return fireMan;
}
Also used : SystemScript(org.dbflute.helper.process.SystemScript) DfSqlFileFireMan(org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan) DfSqlFileRunner(org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunner) File(java.io.File)

Example 7 with DfSqlFileFireMan

use of org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan in project dbflute-core by dbflute.

the class DfTakeFinallyProcess method takeFinally.

// ===================================================================================
// Take Finally
// ============
protected DfSqlFileFireResult takeFinally(DfRunnerInformation runInfo) {
    _log.info("");
    _log.info("* * * * * * * **");
    _log.info("*              *");
    _log.info("* Take Finally *");
    _log.info("*              *");
    _log.info("* * * * * * * **");
    final DfSqlFileFireMan fireMan = createSqlFileFireMan();
    final DfSqlFileFireResult result = fireMan.fire(getSqlFileRunner4TakeFinally(runInfo), getTakeFinallySqlFileList());
    conventionalTakeAssertIfNeeds();
    return result;
}
Also used : DfSqlFileFireMan(org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan) DfSqlFileFireResult(org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireResult)

Example 8 with DfSqlFileFireMan

use of org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan in project dbflute-core by dbflute.

the class DfAlterCheckProcess method createSqlFileFireMan.

protected DfSqlFileFireMan createSqlFileFireMan() {
    final String[] scriptExtAry = SystemScript.getSupportedExtList().toArray(new String[] {});
    final SystemScript script = new SystemScript();
    final DfSqlFileFireMan fireMan = new DfSqlFileFireMan() {

        @Override
        protected DfSqlFileRunnerResult processSqlFile(DfSqlFileRunner runner, File sqlFile) {
            _executedAlterSqlFileList.add(sqlFile);
            if (isScriptFile(sqlFile, scriptExtAry)) {
                return processScriptFile(runner, script, sqlFile);
            } else {
                // mainly here
                return super.processSqlFile(runner, sqlFile);
            }
        }
    };
    fireMan.setExecutorName("Alter Schema");
    return fireMan;
}
Also used : SystemScript(org.dbflute.helper.process.SystemScript) DfSqlFileFireMan(org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan) DfSqlFileRunner(org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunner) File(java.io.File)

Example 9 with DfSqlFileFireMan

use of org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan in project dbflute-core by dbflute.

the class DfOutsideSqlTestTask method doExecute.

// ===================================================================================
// Execute
// =======
@Override
protected void doExecute() {
    final DfRunnerInformation runInfo = createRunnerInformation();
    final DfSqlFileFireMan fireMan = createSqlFileFireMan();
    final List<File> sqlFileList = getTargetSqlFileList();
    _fireResult = fireMan.fire(getSqlFileRunner(runInfo), sqlFileList);
    handleSqlFileFailure(_fireResult, sqlFileList);
}
Also used : DfSqlFileFireMan(org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan) DfRunnerInformation(org.dbflute.helper.jdbc.DfRunnerInformation) File(java.io.File) DfSpecifiedSqlFile(org.dbflute.task.bs.assistant.DfSpecifiedSqlFile)

Example 10 with DfSqlFileFireMan

use of org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan in project dbflute-core by dbflute.

the class DfSql2EntityTask method doExecute.

// ===================================================================================
// Execute
// =======
@Override
protected void doExecute() {
    setupControlTemplate();
    setupSchemaInformation();
    final DfRunnerInformation runInfo = new DfRunnerInformation();
    runInfo.setDriver(getDriver());
    runInfo.setUrl(getUrl());
    runInfo.setUser(getUser());
    runInfo.setPassword(getPassword());
    // Sql2Entity task immediately breaks the process by error
    runInfo.setBreakCauseThrow(true);
    runInfo.setErrorContinue(false);
    runInfo.setAutoCommit(false);
    // this task does not commit
    runInfo.setRollbackOnly(true);
    // requires to be roll-backed correctly
    runInfo.setIgnoreTxError(false);
    runInfo.setEncoding(getOutsideSqlProperties().getSqlFileEncoding());
    // FireMan's fire result is ignored here because runner's option breakCauseThrow=true
    final DfSqlFileFireMan fireMan = new DfSqlFileFireMan();
    final DfOutsideSqlPack outsideSqlPack = getTargetSqlFileList();
    final DfSqlFileRunner runner = createSqlFileRunner(runInfo, outsideSqlPack);
    fireMan.fire(runner, outsideSqlPack.getPhysicalFileList());
    setupProcedure();
    fireVelocityProcess();
    setupBehaviorQueryPath();
    setupExtendedClassDescription();
    reflectGapileClassIfNeeds();
    showTargetSqlFileInformation(outsideSqlPack);
    showSkippedFileInformation();
    handleException();
    refreshResources();
}
Also used : DfSqlFileFireMan(org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan) DfSqlFileRunner(org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunner) DfRunnerInformation(org.dbflute.helper.jdbc.DfRunnerInformation) DfOutsideSqlPack(org.dbflute.logic.sql2entity.analyzer.DfOutsideSqlPack)

Aggregations

DfSqlFileFireMan (org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireMan)10 File (java.io.File)7 DfSqlFileRunner (org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunner)6 DfRunnerInformation (org.dbflute.helper.jdbc.DfRunnerInformation)5 DfSqlFileFireResult (org.dbflute.helper.jdbc.sqlfile.DfSqlFileFireResult)4 SystemScript (org.dbflute.helper.process.SystemScript)3 DfTakeFinallyAssertionFailureException (org.dbflute.exception.DfTakeFinallyAssertionFailureException)2 SQLException (java.sql.SQLException)1 DfAlterCheckAlterScriptSQLException (org.dbflute.exception.DfAlterCheckAlterScriptSQLException)1 DfSqlFileRunnerResult (org.dbflute.helper.jdbc.sqlfile.DfSqlFileRunnerResult)1 ProcessResult (org.dbflute.helper.process.ProcessResult)1 SystemScriptUnsupportedScriptException (org.dbflute.helper.process.exception.SystemScriptUnsupportedScriptException)1 DfOutsideSqlPack (org.dbflute.logic.sql2entity.analyzer.DfOutsideSqlPack)1 DfSpecifiedSqlFile (org.dbflute.task.bs.assistant.DfSpecifiedSqlFile)1