public void saveRep(Repository rep, long id_transformation, long id_step) throws KettleException {
    try {
      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,
          "id_connection_read",
          databaseReadMeta == null ? -1 : databaseReadMeta.getID()); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation,
          id_step,
          "id_connection_write",
          databaseWriteMeta == null
              ? -1
              : databaseWriteMeta
                  .getID()); //$NON-NLS-1$			rep.saveStepAttribute(id_transformation, id_step,
      // "commit",         commitSize); //$NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "cache_size", cacheSize); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "replace", replaceFields); // $NON-NLS-1$

      rep.saveStepAttribute(id_transformation, id_step, "crc", useHash); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "crcfield", hashField); // $NON-NLS-1$

      for (int i = 0; i < keyField.length; i++) {
        rep.saveStepAttribute(
            id_transformation, id_step, i, "lookup_key_name", keyField[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation, id_step, i, "lookup_key_field", keyLookup[i]); // $NON-NLS-1$
      }

      rep.saveStepAttribute(
          id_transformation,
          id_step,
          "return_name",
          Const.isEmpty(technicalKeyField) ? "" : technicalKeyField); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "sequence", sequenceFrom); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation, id_step, "creation_method", techKeyCreation); // $NON-NLS-1$

      // For the moment still save 'use_autoinc' for backwards compatibility (Sven Boden).
      rep.saveStepAttribute(id_transformation, id_step, "use_autoinc", useAutoinc); // $NON-NLS-1$

      rep.saveStepAttribute(
          id_transformation, id_step, "last_update_field", lastUpdateField); // $NON-NLS-1$

      // Also, save the step-database relationship!
      if (databaseReadMeta != null)
        rep.insertStepDatabase(id_transformation, id_step, databaseReadMeta.getID());
      if (databaseWriteMeta != null)
        rep.insertStepDatabase(id_transformation, id_step, databaseWriteMeta.getID());
    } catch (Exception e) {
      throw new KettleException(
          Messages.getString("ConcurrentCombinationLookupMeta.Exception.UnableToSaveStepInfo")
              + id_step,
          e); //$NON-NLS-1$
    }
  }
Esempio n. 2
0
  public void saveRep(Repository rep, long id_transformation, long id_step) throws KettleException {
    try {
      rep.saveStepAttribute(
          id_transformation,
          id_step,
          "id_connection",
          databaseMeta == null ? -1 : databaseMeta.getID()); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "commit", commitSize); // $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$

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

      // Also, save the step-database relationship!
      if (databaseMeta != null)
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getID());
    } catch (Exception e) {
      throw new KettleException(
          Messages.getString("DeleteMeta.Exception.UnableToSaveStepInfo") + id_step,
          e); //$NON-NLS-1$
    }
  }
Esempio n. 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, "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);
    }
  }
  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);
    }
  }
  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);
    }
  }
  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);
    }
  }
  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);
    }
  }
  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$
    }
  }
  public void saveRep(Repository rep, long id_transformation, long id_step) throws KettleException {
    try {
      rep.saveStepAttribute(
          id_transformation,
          id_step,
          "id_connection",
          databaseMeta == null ? -1 : databaseMeta.getID()); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "cache", cached); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation, id_step, "cache_load_all", loadingAllDataInCache); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "cache_size", cacheSize); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "lookup_schema", schemaName); // $NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, "lookup_table", tablename); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation, id_step, "lookup_orderby", orderByClause); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation, id_step, "fail_on_multiple", failingOnMultipleResults); // $NON-NLS-1$
      rep.saveStepAttribute(
          id_transformation,
          id_step,
          "eat_row_on_failure",
          eatingRowOnLookupFailure); //$NON-NLS-1$

      for (int i = 0; i < streamKeyField1.length; i++) {
        rep.saveStepAttribute(
            id_transformation, id_step, i, "lookup_key_name", streamKeyField1[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation, id_step, i, "lookup_key_field", tableKeyField[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation, id_step, i, "lookup_key_condition", keyCondition[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation, id_step, i, "lookup_key_name2", streamKeyField2[i]); // $NON-NLS-1$
      }

      for (int i = 0; i < returnValueField.length; i++) {
        rep.saveStepAttribute(
            id_transformation, id_step, i, "return_value_name", returnValueField[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "return_value_rename",
            returnValueNewName[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "return_value_default",
            returnValueDefault[i]); // $NON-NLS-1$
        rep.saveStepAttribute(
            id_transformation,
            id_step,
            i,
            "return_value_type",
            ValueMeta.getTypeDesc(returnValueDefaultType[i])); // $NON-NLS-1$
      }

      // Also, save the step-database relationship!
      if (databaseMeta != null)
        rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getID());
    } catch (Exception e) {
      throw new KettleException(
          Messages.getString("DatabaseLookupMeta.ERROR0003.UnableToSaveStepToRepository") + id_step,
          e); //$NON-NLS-1$
    }
  }