Java Code Examples for org.pentaho.di.repository.Repository#saveDatabaseMetaStepAttribute()

The following examples show how to use org.pentaho.di.repository.Repository#saveDatabaseMetaStepAttribute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColumnExistsMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", database );
    rep.saveStepAttribute( id_transformation, id_step, "tablename", tablename );
    rep.saveStepAttribute( id_transformation, id_step, "schemaname", schemaname );
    rep.saveStepAttribute( id_transformation, id_step, "istablenameInfield", istablenameInfield );
    rep.saveStepAttribute( id_transformation, id_step, "tablenamefield", tablenamefield );
    rep.saveStepAttribute( id_transformation, id_step, "columnnamefield", columnnamefield );
    rep.saveStepAttribute( id_transformation, id_step, "resultfieldname", resultfieldname );

    // Also, save the step-database relationship!
    if ( database != null ) {
      rep.insertStepDatabase( id_transformation, id_step, database.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException(
        BaseMessages.getString( PKG, "ColumnExistsMeta.Exception.UnableToSaveStepInfo" ) + id_step, e );
  }
}
 
Example 2
Source File: OpenERPObjectOutputMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId idTransformation, ObjectId idStep )
  throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( idTransformation, idStep, "connection", this.databaseMeta );
    rep.saveStepAttribute( idTransformation, idStep, "modelName", this.modelName );
    rep.saveStepAttribute( idTransformation, idStep, "readBatchSize", this.commitBatchSize );
    rep.saveStepAttribute( idTransformation, idStep, "outputIDField", this.outputIDField );
    rep.saveStepAttribute( idTransformation, idStep, "outputIDFieldName", this.outputIDFieldName );

    for ( int i = 0; i < modelFields.length; i++ ) {
      rep.saveStepAttribute( idTransformation, idStep, i, "model_field", modelFields[i] );
      rep.saveStepAttribute( idTransformation, idStep, i, "stream_field", streamFields[i] );
    }

    for ( int i = 0; i < keyLookups.size(); i++ ) {
      rep.saveStepAttribute( idTransformation, idStep, i, "model_key_field", keyLookups.get( i )[0] );
      rep.saveStepAttribute( idTransformation, idStep, i, "comparitor", keyLookups.get( i )[1] );
      rep.saveStepAttribute( idTransformation, idStep, i, "stream_key_field", keyLookups.get( i )[2] );
    }
  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for idStep=" + idStep, e );
  }
}
 
Example 3
Source File: MondrianInputMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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, "sql", sql );
    rep.saveStepAttribute( id_transformation, id_step, "catalog", catalog );
    rep.saveStepAttribute( id_transformation, id_step, "role", role );
    rep.saveStepAttribute( id_transformation, id_step, "variables_active", variableReplacementActive );

    // 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 );
  }
}
 
Example 4
Source File: TableInputMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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, "sql", sql );
    rep.saveStepAttribute( id_transformation, id_step, "limit", rowLimit );
    StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );
    rep.saveStepAttribute( id_transformation, id_step, "lookup", infoStream.getStepname() );
    rep.saveStepAttribute( id_transformation, id_step, "execute_each_row", executeEachInputRow );
    rep.saveStepAttribute( id_transformation, id_step, "variables_active", variableReplacementActive );
    rep.saveStepAttribute( id_transformation, id_step, "lazy_conversion_active", lazyConversionActive );
    rep.saveStepAttribute( id_transformation, id_step, "cached_row_meta_active", cachedRowMetaActive );
    if ( cachedRowMeta != null ) {
      rep.saveStepAttribute( id_transformation, id_step, RowMeta.XML_META_TAG, cachedRowMeta.getMetaXML() );
    }

    // 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 );
  }
}
 
Example 5
Source File: DeleteMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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 );

    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] );
    }

    // 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, "DeleteMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 6
Source File: PaloDimOutputMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId idTransformation, ObjectId idStep )
  throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( idTransformation, idStep, "connection", databaseMeta );
    rep.saveStepAttribute( idTransformation, idStep, "dimension", this.dimension );
    rep.saveStepAttribute( idTransformation, idStep, "elementtype", this.elementType );
    rep.saveStepAttribute( idTransformation, idStep, "createdimension", this.createNewDimension );
    rep.saveStepAttribute( idTransformation, idStep, "cleardimension", this.clearDimension );
    rep.saveStepAttribute( idTransformation, idStep, "clearconsolidations", this.clearConsolidations );
    rep.saveStepAttribute( idTransformation, idStep, "recreatedimension", this.recreateDimension );
    rep.saveStepAttribute( idTransformation, idStep, "enableElementCache", this.enableElementCache );
    rep.saveStepAttribute( idTransformation, idStep, "preloadElementCache", this.preloadElementCache );

    for ( int i = 0; i < levels.size(); i++ ) {
      rep.saveStepAttribute( idTransformation, idStep, i, "levelname", this.levels.get( i ).getLevelName() );
      rep.saveStepAttribute( idTransformation, idStep, i, "levelnumber", this.levels.get( i ).getLevelNumber() );
      rep.saveStepAttribute( idTransformation, idStep, i, "fieldname", this.levels.get( i ).getFieldName() );
      rep.saveStepAttribute( idTransformation, idStep, i, "fieldtype", this.levels.get( i ).getFieldType() );
      rep.saveStepAttribute( idTransformation, idStep, i, "consolidationfieldname", this.levels.get( i )
          .getConsolidationFieldName() );
    }

  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for idStep=" + idStep, e );
  }
}
 
Example 7
Source File: DatabaseJoinMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Override
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, "rowlimit", rowLimit );
    rep.saveStepAttribute( id_transformation, id_step, "sql", sql );
    rep.saveStepAttribute( id_transformation, id_step, "outer_join", outerJoin );
    rep.saveStepAttribute( id_transformation, id_step, "replace_vars", replacevars );

    for ( int i = 0; i < parameterField.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "parameter_field", parameterField[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "parameter_type", ValueMetaFactory
          .getValueMetaName( parameterType[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, "DatabaseJoinMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 8
Source File: TableExistsMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", database );
    rep.saveStepAttribute( id_transformation, id_step, "tablenamefield", tablenamefield );
    rep.saveStepAttribute( id_transformation, id_step, "schemaname", schemaname );

    rep.saveStepAttribute( id_transformation, id_step, "resultfieldname", resultfieldname );

    // Also, save the step-database relationship!
    if ( database != null ) {
      rep.insertStepDatabase( id_transformation, id_step, database.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "TableExistsMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 9
Source File: PGBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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, "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 );
  }
}
 
Example 10
Source File: MySQLBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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 );
  }
}
 
Example 11
Source File: AddSequenceMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "valuename", valuename );

    rep.saveStepAttribute( id_transformation, id_step, "use_database", useDatabase );

    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", database );

    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "seqname", sequenceName );

    rep.saveStepAttribute( id_transformation, id_step, "use_counter", useCounter );
    rep.saveStepAttribute( id_transformation, id_step, "counter_name", counterName );
    rep.saveStepAttribute( id_transformation, id_step, "start_at", startAt );
    rep.saveStepAttribute( id_transformation, id_step, "increment_by", incrementBy );
    rep.saveStepAttribute( id_transformation, id_step, "max_value", maxValue );

    // Also, save the step-database relationship!
    if ( database != null ) {
      rep.insertStepDatabase( id_transformation, id_step, database.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "AddSequenceMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 12
Source File: LucidDBBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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, "errors", maxErrors );
    rep.saveStepAttribute( id_transformation, id_step, "buffer_size", bufferSize );
    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, "fifo_directory", fifoDirectory );
    rep.saveStepAttribute( id_transformation, id_step, "fifo_server_name", fifoServerName );

    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", fieldFormatOk[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, "LucidDBBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 13
Source File: TableCompareMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute(
      id_transformation, id_step, "reference_connection_id", referenceConnection );
    rep.saveStepAttribute( id_transformation, id_step, "reference_schema_field", referenceSchemaField );
    rep.saveStepAttribute( id_transformation, id_step, "reference_table_field", referenceTableField );

    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "compare_connection_id", compareConnection );
    rep.saveStepAttribute( id_transformation, id_step, "compare_schema_field", compareSchemaField );
    rep.saveStepAttribute( id_transformation, id_step, "compare_table_field", compareTableField );

    rep.saveStepAttribute( id_transformation, id_step, "key_fields_field", keyFieldsField );
    rep.saveStepAttribute( id_transformation, id_step, "exclude_fields_field", excludeFieldsField );
    rep.saveStepAttribute( id_transformation, id_step, "nr_errors_field", nrErrorsField );

    rep.saveStepAttribute( id_transformation, id_step, "nr_records_reference_field", nrRecordsReferenceField );
    rep.saveStepAttribute( id_transformation, id_step, "nr_records_compare_field", nrRecordsCompareField );
    rep.saveStepAttribute( id_transformation, id_step, "nr_errors_left_join_field", nrErrorsLeftJoinField );
    rep.saveStepAttribute( id_transformation, id_step, "nr_errors_inner_join_field", nrErrorsInnerJoinField );
    rep.saveStepAttribute( id_transformation, id_step, "nr_errors_right_join_field", nrErrorsRightJoinField );

    rep.saveStepAttribute( id_transformation, id_step, "key_description_field", keyDescriptionField );
    rep.saveStepAttribute( id_transformation, id_step, "value_reference_field", valueReferenceField );
    rep.saveStepAttribute( id_transformation, id_step, "value_compare_field", valueCompareField );
  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
  }
}
 
Example 14
Source File: OpenERPObjectInputMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId idTransformation, ObjectId idStep )
  throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( idTransformation, idStep, "connection", this.databaseMeta );
    rep.saveStepAttribute( idTransformation, idStep, "modelName", this.modelName );
    rep.saveStepAttribute( idTransformation, idStep, "readBatchSize", this.readBatchSize );

    for ( int i = 0; i < getMappings().size(); i++ ) {
      FieldMapping map = this.getMappings().get( i );
      rep.saveStepAttribute( idTransformation, idStep, i, "source_model", map.source_model );
      rep.saveStepAttribute( idTransformation, idStep, i, "source_field", map.source_field );
      rep.saveStepAttribute( idTransformation, idStep, i, "source_index", map.source_index );
      rep.saveStepAttribute( idTransformation, idStep, i, "target_model", map.target_model );
      rep.saveStepAttribute( idTransformation, idStep, i, "target_field", map.target_field );
      rep.saveStepAttribute( idTransformation, idStep, i, "target_field_label", map.target_field_label );
      rep.saveStepAttribute( idTransformation, idStep, i, "target_field_type", map.target_field_type );
    }

    for ( int i = 0; i < getFilterList().size(); i++ ) {
      ReadFilter filter = this.getFilterList().get( i );
      rep.saveStepAttribute( idTransformation, idStep, i, "operator", filter.getOperator() );
      rep.saveStepAttribute( idTransformation, idStep, i, "field_name", filter.getFieldName() );
      rep.saveStepAttribute( idTransformation, idStep, i, "comparator", filter.getComparator() );
      rep.saveStepAttribute( idTransformation, idStep, i, "value", filter.getValue() );
    }

  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for idStep=" + idStep, e );
  }
}
 
Example 15
Source File: LucidDBStreamingLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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, "host", host );
    rep.saveStepAttribute( id_transformation, id_step, "port", port );
    rep.saveStepAttribute( id_transformation, id_step, "operation", operation );
    rep.saveStepAttribute( id_transformation, id_step, "custom_sql", custom_sql );

    for ( int i = 0; i < fieldTableForKeys.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "key_field_name", fieldTableForKeys[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "key_stream_name", fieldStreamForKeys[i] );

    }

    for ( int i = 0; i < fieldTableForFields.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "field_field_name", fieldTableForFields[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_stream_name", fieldStreamForFields[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "insert_or_update_flag", insOrUptFlag[i] );
    }

    for ( int i = 0; i < tabIsEnable.length; i++ ) {

      rep.saveStepAttribute( id_transformation, id_step, i, "tab_is_enable", tabIsEnable[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, "LucidDBStreamingLoaderMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 16
Source File: MonetDBBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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 );
    // General Settings Tab
    rep.saveStepAttribute( id_transformation, id_step, "db_connection_name", dbConnectionName );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );
    rep.saveStepAttribute( id_transformation, id_step, "buffer_size", bufferSize );
    rep.saveStepAttribute( id_transformation, id_step, "log_file", logFile );
    rep.saveStepAttribute( id_transformation, id_step, "truncate", truncate );
    rep.saveStepAttribute( id_transformation, id_step, "fully_quote_sql", fullyQuoteSQL );

    // MonetDB Settings Tab
    rep.saveStepAttribute( id_transformation, id_step, "field_separator", fieldSeparator );
    rep.saveStepAttribute( id_transformation, id_step, "field_enclosure", fieldEnclosure );
    rep.saveStepAttribute( id_transformation, id_step, "null_representation", NULLrepresentation );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );

    // Output Fields Tab
    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", fieldFormatOk[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, "MonetDBBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
  }
}
 
Example 17
Source File: SynchronizeAfterMergeMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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, "tablename_in_field", tablenameInField );
    rep.saveStepAttribute( id_transformation, id_step, "tablename_field", tablenameField );
    rep.saveStepAttribute( id_transformation, id_step, "operation_order_field", operationOrderField );
    rep.saveStepAttribute( id_transformation, id_step, "order_insert", OrderInsert );
    rep.saveStepAttribute( id_transformation, id_step, "order_update", OrderUpdate );
    rep.saveStepAttribute( id_transformation, id_step, "order_delete", OrderDelete );

    rep.saveStepAttribute( id_transformation, id_step, "use_batch", useBatchUpdate );
    rep.saveStepAttribute( id_transformation, id_step, "perform_lookup", performLookup );

    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, "SynchronizeAfterMergeMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 18
Source File: SapInputMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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 );
    if ( function != null && !Utils.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 );
  }
}
 
Example 19
Source File: OraBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
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, "bind_size", bindSize );
    rep.saveStepAttribute( id_transformation, id_step, "read_size", readSize );
    rep.saveStepAttribute( id_transformation, id_step, "errors", maxErrors );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );

    rep.saveStepAttribute( id_transformation, id_step, "load_method", loadMethod );
    rep.saveStepAttribute( id_transformation, id_step, "load_action", loadAction );
    rep.saveStepAttribute( id_transformation, id_step, "sqlldr", sqlldr );
    rep.saveStepAttribute( id_transformation, id_step, "control_file", controlFile );
    rep.saveStepAttribute( id_transformation, id_step, "data_file", dataFile );
    rep.saveStepAttribute( id_transformation, id_step, "log_file", logFile );
    rep.saveStepAttribute( id_transformation, id_step, "bad_file", badFile );
    rep.saveStepAttribute( id_transformation, id_step, "discard_file", discardFile );

    rep.saveStepAttribute( id_transformation, id_step, "direct_path", directPath );
    rep.saveStepAttribute( id_transformation, id_step, "erase_files", eraseFiles );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "dbname_override", dbNameOverride );

    rep.saveStepAttribute( id_transformation, id_step, "character_set", characterSetName );
    rep.saveStepAttribute( id_transformation, id_step, "fail_on_warning", failOnWarning );
    rep.saveStepAttribute( id_transformation, id_step, "fail_on_error", failOnError );
    rep.saveStepAttribute( id_transformation, id_step, "parallel", parallel );
    rep.saveStepAttribute( id_transformation, id_step, "alt_rec_term", altRecordTerm );

    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, "OraBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 20
Source File: GPLoadMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
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, "errors", maxErrors );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );
    rep.saveStepAttribute( id_transformation, id_step, "error_table", errorTableName );
    rep.saveStepAttribute( id_transformation, id_step, "load_method", loadMethod );
    rep.saveStepAttribute( id_transformation, id_step, "load_action", loadAction );
    rep.saveStepAttribute( id_transformation, id_step, "gpload_path", gploadPath );
    rep.saveStepAttribute( id_transformation, id_step, "control_file", controlFile );
    rep.saveStepAttribute( id_transformation, id_step, "data_file", dataFile );
    rep.saveStepAttribute( id_transformation, id_step, "delimiter", delimiter );
    rep.saveStepAttribute( id_transformation, id_step, "log_file", logFile );
    rep.saveStepAttribute( id_transformation, id_step, "null_as", nullAs );
    rep.saveStepAttribute( id_transformation, id_step, "erase_files", eraseFiles );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "enclose_numbers", ( encloseNumbers ? "Y" : "N" ) );
    rep.saveStepAttribute( id_transformation, id_step, "localhost_port", localhostPort );
    rep.saveStepAttribute( id_transformation, id_step, "update_condition", updateCondition );

    for ( int i = 0; i < localHosts.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "local_host", localHosts[i] );
    }

    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] );
      rep.saveStepAttribute( id_transformation, id_step, i, "match_column", matchColumn[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "update_column", updateColumn[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, "GPLoadMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
  }
}