Ejemplo n.º 1
0
 // ===================================================================================
 //                                                                SQL File Information
 //                                                                ====================
 protected void showTargetSqlFileInformation(DfOutsideSqlPack outsideSqlPack) {
   final StringBuilder sb = new StringBuilder();
   sb.append(ln()).append("/- - - - - - - - - - - - - - - - - - - - - - - -");
   sb.append(ln()).append("Target SQL files: ").append(outsideSqlPack.size());
   sb.append(ln());
   for (DfOutsideSqlFile sqlFile : outsideSqlPack.getOutsideSqlFileList()) {
     sb.append(ln()).append("  ").append(sqlFile.getPhysicalFile().getName());
   }
   sb.append(ln()).append("- - - - - - - - - -/");
   _log.info(sb);
 }
Ejemplo n.º 2
0
 // ===================================================================================
 //                                                                   Executing Element
 //                                                                   =================
 protected DfOutsideSqlPack getTargetSqlFileList() {
   final DfOutsideSqlPack sqlFileList = collectOutsideSqlChecked();
   final String specifiedSqlFile = DfSpecifiedSqlFile.getInstance().getSpecifiedSqlFile();
   if (specifiedSqlFile != null) {
     final DfOutsideSqlPack filteredList = new DfOutsideSqlPack();
     for (DfOutsideSqlFile outsideSqlFile : sqlFileList.getOutsideSqlFileList()) {
       final String fileName = outsideSqlFile.getPhysicalFile().getName();
       if (specifiedSqlFile.equals(fileName)) {
         filteredList.add(outsideSqlFile);
       }
     }
     return filteredList;
   } else {
     return sqlFileList;
   }
 }
Ejemplo n.º 3
0
  // ===================================================================================
  //                                                                             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);
    runInfo.setRollbackOnly(true); // this task does not commit
    runInfo.setIgnoreTxError(false); // requires to be roll-backed correctly
    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();

    showTargetSqlFileInformation(outsideSqlPack);
    showSkippedFileInformation();
    handleException();
    refreshResources();
  }