コード例 #1
0
  public void saveRep(
      Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
      rep.saveStepAttribute(id_transformation, id_step, "commit", commitSize);
      rep.saveStepAttribute(id_transformation, id_step, "schema", schemaName);
      rep.saveStepAttribute(id_transformation, id_step, "table", tableName);
      rep.saveStepAttribute(id_transformation, id_step, "update_bypassed", updateBypassed);

      for (int i = 0; i < keyStream.length; i++) {
        rep.saveStepAttribute(id_transformation, id_step, i, "key_name", keyStream[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "key_field", keyLookup[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "key_condition", keyCondition[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "key_name2", keyStream2[i]);
      }

      for (int i = 0; i < updateLookup.length; i++) {
        rep.saveStepAttribute(id_transformation, id_step, i, "value_name", updateLookup[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "value_rename", updateStream[i]);
        rep.saveStepAttribute(
            id_transformation, id_step, i, "value_update", update[i].booleanValue());
      }

      // Also, save the step-database relationship!
      if (databaseMeta != null) {
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
      }
    } catch (Exception e) {
      throw new KettleException(
          BaseMessages.getString(PKG, "InsertUpdateMeta.Exception.UnableToSaveStepInfoToRepository")
              + id_step,
          e);
    }
  }
コード例 #2
0
  public void saveRep(
      Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);

      rep.saveStepAttribute(id_transformation, id_step, "schema", schemaName);
      rep.saveStepAttribute(id_transformation, id_step, "table", tableName);

      rep.saveStepAttribute(id_transformation, id_step, "load_action", loadAction);
      rep.saveStepAttribute(id_transformation, id_step, "PsqlPath", PsqlPath);

      rep.saveStepAttribute(id_transformation, id_step, "dbname_override", dbNameOverride);
      rep.saveStepAttribute(id_transformation, id_step, "enclosure", enclosure);
      rep.saveStepAttribute(id_transformation, id_step, "delimiter", delimiter);
      rep.saveStepAttribute(id_transformation, id_step, "stop_on_error", stopOnError);

      for (int i = 0; i < fieldTable.length; i++) {
        rep.saveStepAttribute(id_transformation, id_step, i, "stream_name", fieldTable[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "field_name", fieldStream[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "date_mask", dateMask[i]);
      }

      // Also, save the step-database relationship!
      if (databaseMeta != null) {
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
      }
    } catch (Exception e) {
      throw new KettleException(
          BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository")
              + id_step,
          e);
    }
  }
コード例 #3
0
  public void saveRep(
      Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
      rep.saveStepAttribute(id_transformation, id_step, "commit", commitSize);
      rep.saveStepAttribute(id_transformation, id_step, "sql_field", sqlField);

      rep.saveStepAttribute(id_transformation, id_step, "insert_field", insertField);
      rep.saveStepAttribute(id_transformation, id_step, "update_field", updateField);
      rep.saveStepAttribute(id_transformation, id_step, "delete_field", deleteField);
      rep.saveStepAttribute(id_transformation, id_step, "read_field", readField);

      // Also, save the step-database relationship!
      if (databaseMeta != null) {
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
      }

      rep.saveStepAttribute(id_transformation, id_step, "sqlFromfile", sqlFromfile);
      rep.saveStepAttribute(id_transformation, id_step, "sendOneStatement", sendOneStatement);
    } catch (Exception e) {
      throw new KettleException(
          BaseMessages.getString(PKG, "ExecSQLRowMeta.Exception.UnableToSaveStepInfo") + id_step,
          e);
    }
  }
コード例 #4
0
  public void saveRep(
      Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
      rep.saveStepAttribute(id_transformation, id_step, "table", tablename);
      rep.saveStepAttribute(id_transformation, id_step, "fifo_file_name", fifoFileName);
      rep.saveStepAttribute(id_transformation, id_step, "sql_path", sqlPath);
      rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding);
      rep.saveStepAttribute(id_transformation, id_step, "delimiter", delimiter);
      rep.saveStepAttribute(id_transformation, id_step, "continue_on_error", continueOnError);
      rep.saveStepAttribute(id_transformation, id_step, "error_file_name", errorFileName);
      rep.saveStepAttribute(
          id_transformation, id_step, "use_standard_conversion", useStandardConversion);
      rep.saveStepAttribute(id_transformation, id_step, "use_authentication", useAuthentication);
      rep.saveStepAttribute(id_transformation, id_step, "use_dynamic_vnode", useDynamicVNode);
      rep.saveStepAttribute(id_transformation, id_step, "use_SSV_delimiter", useSSV);
      rep.saveStepAttribute(
          id_transformation, id_step, "escape_special_characters", escapingSpecialCharacters);
      rep.saveStepAttribute(id_transformation, id_step, "use_vwload", usingVwload);
      rep.saveStepAttribute(id_transformation, id_step, "max_errors", maxNrErrors);
      rep.saveStepAttribute(id_transformation, id_step, "truncate_table", truncatingTable);
      rep.saveStepAttribute(id_transformation, id_step, "buffer_size", bufferSize);

      int nrRows =
          (fieldDatabase.length < fieldStream.length ? fieldStream.length : fieldDatabase.length);
      for (int idx = 0; idx < nrRows; idx++) {
        String columnName = (idx < fieldDatabase.length ? fieldDatabase[idx] : "");
        String streamName = (idx < fieldStream.length ? fieldStream[idx] : "");
        rep.saveStepAttribute(id_transformation, id_step, idx, "column_name", columnName);
        rep.saveStepAttribute(id_transformation, id_step, idx, "stream_name", streamName);
      }

      // Also, save the step-database relationship!
      if (databaseMeta != null) {
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
      }
    } catch (Exception e) {
      throw new KettleException(
          "Unable to save step information to the repository for id_step=" + id_step, e);
    }
  }
コード例 #5
0
  public void saveRep(
      Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
      rep.saveStepAttribute(id_transformation, id_step, "schema", schemaName);
      rep.saveStepAttribute(id_transformation, id_step, "table", tableName);
      rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding);
      rep.saveStepAttribute(id_transformation, id_step, "enclosure", enclosure);
      rep.saveStepAttribute(id_transformation, id_step, "delimiter", delimiter);
      rep.saveStepAttribute(id_transformation, id_step, "escape_char", escapeChar);
      rep.saveStepAttribute(id_transformation, id_step, "fifo_file_name", fifoFileName);
      rep.saveStepAttribute(id_transformation, id_step, "replace", replacingData);
      rep.saveStepAttribute(id_transformation, id_step, "ignore", ignoringErrors);
      rep.saveStepAttribute(id_transformation, id_step, "local", localFile);
      rep.saveStepAttribute(id_transformation, id_step, "bulk_size", bulkSize);

      for (int i = 0; i < fieldTable.length; i++) {
        rep.saveStepAttribute(id_transformation, id_step, i, "stream_name", fieldTable[i]);
        rep.saveStepAttribute(id_transformation, id_step, i, "field_name", fieldStream[i]);
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "field_format_ok",
            getFieldFormatTypeCode(fieldFormatType[i]));
      }

      // Also, save the step-database relationship!
      if (databaseMeta != null) {
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
      }
    } catch (Exception e) {
      throw new KettleException(
          BaseMessages.getString(
                  PKG, "MySQLBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository")
              + id_step,
          e);
    }
  }
コード例 #6
0
  public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
      rep.saveStepAttribute(id_transformation, id_step, "errors", maxErrors); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "schema", schemaName); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "table", tableName); // $NON-NLS-1$

      rep.saveStepAttribute(id_transformation, id_step, "load_method", loadMethod); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "load_action", loadAction); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "PsqlPath", PsqlPath); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "control_file", controlFile); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "data_file", dataFile); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "log_file", logFile); // $NON-NLS-1$

      rep.saveStepAttribute(id_transformation, id_step, "erase_files", eraseFiles); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation, id_step, "dbname_override", dbNameOverride); // $NON-NLS-1$

      for (int i = 0; i < fieldTable.length; i++) {
        rep.saveStepAttribute(
            id_transformation, id_step, i, "stream_name", fieldTable[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation, id_step, i, "field_name", fieldStream[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation, id_step, i, "date_mask", dateMask[i]); // $NON-NLS-1$
      }

      // Also, save the step-database relationship!
      if (databaseMeta != null)
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
    } catch (Exception e) {
      throw new KettleException(
          BaseMessages.getString(PKG, "GPBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository")
              + id_step,
          e); //$NON-NLS-1$
    }
  }
コード例 #7
0
ファイル: SapInputMeta.java プロジェクト: hoverzheng/kettle
  public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    try {
      rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
      if (function != null && !Const.isEmpty(function.getName())) {
        rep.saveStepAttribute(id_transformation, id_step, "function_name", function.getName());
        rep.saveStepAttribute(
            id_transformation, id_step, "function_description", function.getDescription());
        rep.saveStepAttribute(id_transformation, id_step, "function_group", function.getGroup());
        rep.saveStepAttribute(
            id_transformation, id_step, "function_application", function.getApplication());
        rep.saveStepAttribute(id_transformation, id_step, "function_host", function.getHost());
      }

      for (int i = 0; i < parameters.size(); i++) {
        SapParameter parameter = parameters.get(i);
        rep.saveStepAttribute(
            id_transformation, id_step, i, "parameter_field_name", parameter.getFieldName());
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "parameter_sap_type",
            parameter.getSapType() == null ? null : parameter.getSapType().getCode());
        rep.saveStepAttribute(
            id_transformation, id_step, i, "parameter_table_name", parameter.getTableName());
        rep.saveStepAttribute(
            id_transformation, id_step, i, "parameter_name", parameter.getParameterName());
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "parameter_target_type",
            ValueMeta.getTypeDesc(parameter.getTargetType()));
      }

      for (int i = 0; i < outputFields.size(); i++) {
        SapOutputField field = outputFields.get(i);
        rep.saveStepAttribute(
            id_transformation, id_step, i, "field_sap_field_name", field.getSapFieldName());
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "field_sap_type",
            field.getSapType() == null ? null : field.getSapType().getCode());
        rep.saveStepAttribute(
            id_transformation, id_step, i, "field_table_name", field.getTableName());
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "field_target_type",
            ValueMeta.getTypeDesc(field.getTargetType()));
        rep.saveStepAttribute(id_transformation, id_step, i, "field_new_name", field.getNewName());
      }
    } catch (Exception e) {
      throw new KettleException(
          "Unable to save step information to the repository for id_step=" + id_step, e);
    }
  }