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

The following examples show how to use org.pentaho.di.repository.Repository#insertStepDatabase() . 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: DynamicSQLRowMeta.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, "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 );
    rep.saveStepAttribute( id_transformation, id_step, "sql_fieldname", sqlfieldname );
    rep.saveStepAttribute( id_transformation, id_step, "query_only_on_change", queryonlyonchange );

    // 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, "DynamicSQLRowMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 2
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 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: 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 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: DBProcMeta.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, "procedure", procedure );

    for ( int i = 0; i < argument.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "arg_name", argument[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "arg_direction", argumentDirection[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "arg_type",
        ValueMetaFactory.getValueMetaName( argumentType[i] ) );
    }

    rep.saveStepAttribute( id_transformation, id_step, "result_name", resultName );
    rep.saveStepAttribute( id_transformation, id_step, "result_type",
      ValueMetaFactory.getValueMetaName( resultType ) );
    rep.saveStepAttribute( id_transformation, id_step, "auto_commit", autoCommit );

    // 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, "DBProcMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 7
Source File: UpdateMeta.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, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "skip_lookup", skipLookup );
    rep.saveStepAttribute( id_transformation, id_step, "commit", commitSize );
    rep.saveStepAttribute( id_transformation, id_step, "use_batch", useBatchUpdate );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );

    rep.saveStepAttribute( id_transformation, id_step, "error_ignored", errorIgnored );
    rep.saveStepAttribute( id_transformation, id_step, "ignore_flag_field", ignoreFlagField );

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

    // 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, "UpdateMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 8
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 9
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 10
Source File: ExecSQLMeta.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, "sql", sql );
    rep.saveStepAttribute( id_transformation, id_step, "execute_each_row", executedEachInputRow );
    rep.saveStepAttribute( id_transformation, id_step, "single_statement", singleStatement );
    rep.saveStepAttribute( id_transformation, id_step, "replace_variables", replaceVariables );
    rep.saveStepAttribute( id_transformation, id_step, "quoteString", quoteString );
    rep.saveStepAttribute( id_transformation, id_step, "set_params", setParams );
    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() );
    }

    for ( int i = 0; i < arguments.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "arg_name", arguments[i] );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "ExecSQLMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 11
Source File: GPBulkLoaderMeta.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, "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, "load_method", loadMethod );
    rep.saveStepAttribute( id_transformation, id_step, "load_action", loadAction );
    rep.saveStepAttribute( id_transformation, id_step, "PsqlPath", PsqlPath );
    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, "erase_files", eraseFiles );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "dbname_override", dbNameOverride );

    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 12
Source File: CombinationLookupMeta.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, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tablename );
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "commit", commitSize );
    rep.saveStepAttribute( id_transformation, id_step, "cache_size", cacheSize );
    rep.saveStepAttribute( id_transformation, id_step, "replace", replaceFields );
    rep.saveStepAttribute( id_transformation, id_step, "preloadCache", preloadCache );

    rep.saveStepAttribute( id_transformation, id_step, "crc", useHash );
    rep.saveStepAttribute( id_transformation, id_step, "crcfield", hashField );

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

    rep.saveStepAttribute( id_transformation, id_step, "return_name", technicalKeyField );
    rep.saveStepAttribute( id_transformation, id_step, "sequence", sequenceFrom );
    rep.saveStepAttribute( id_transformation, id_step, "creation_method", techKeyCreation );

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

    rep.saveStepAttribute( id_transformation, id_step, "last_update_field", lastUpdateField );

    // 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, "CombinationLookupMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 13
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 14
Source File: TableOutputMeta.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, "commit", commitSize );
    rep.saveStepAttribute( id_transformation, id_step, "truncate", truncateTable );
    rep.saveStepAttribute( id_transformation, id_step, "ignore_errors", ignoreErrors );
    rep.saveStepAttribute( id_transformation, id_step, "use_batch", useBatchUpdate );
    rep.saveStepAttribute( id_transformation, id_step, "specify_fields", specifyFields );

    rep.saveStepAttribute( id_transformation, id_step, "partitioning_enabled", partitioningEnabled );
    rep.saveStepAttribute( id_transformation, id_step, "partitioning_field", partitioningField );
    rep.saveStepAttribute( id_transformation, id_step, "partitioning_daily", partitioningDaily );
    rep.saveStepAttribute( id_transformation, id_step, "partitioning_monthly", partitioningMonthly );

    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, "tablename_in_table", tableNameInTable );

    rep.saveStepAttribute( id_transformation, id_step, "return_keys", returningGeneratedKeys );
    rep.saveStepAttribute( id_transformation, id_step, "return_field", generatedKeyField );

    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 );
  }
}
 
Example 15
Source File: DatabaseLookupMeta.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, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "cache", cached );
    rep.saveStepAttribute( id_transformation, id_step, "cache_load_all", loadingAllDataInCache );
    rep.saveStepAttribute( id_transformation, id_step, "cache_size", cacheSize );
    rep.saveStepAttribute( id_transformation, id_step, "lookup_schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "lookup_table", tablename );
    rep.saveStepAttribute( id_transformation, id_step, "lookup_orderby", orderByClause );
    rep.saveStepAttribute( id_transformation, id_step, "fail_on_multiple", failingOnMultipleResults );
    rep.saveStepAttribute( id_transformation, id_step, "eat_row_on_failure", eatingRowOnLookupFailure );

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

    for ( int i = 0; i < returnValueField.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "return_value_name", returnValueField[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "return_value_rename", returnValueNewName[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "return_value_default", returnValueDefault[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "return_value_type", ValueMetaFactory
          .getValueMetaName( returnValueDefaultType[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, "DatabaseLookupMeta.ERROR0003.UnableToSaveStepToRepository" )
      + id_step, e );
  }

}
 
Example 16
Source File: SQLFileOutputMeta.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, "truncate", truncateTable );
    rep.saveStepAttribute( id_transformation, id_step, "create", createTable );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "dateformat", dateformat );
    rep.saveStepAttribute( id_transformation, id_step, "addtoresult", AddToResult );
    rep.saveStepAttribute( id_transformation, id_step, "startnewline", StartNewLine );

    rep.saveStepAttribute( id_transformation, id_step, "file_name", fileName );
    rep.saveStepAttribute( id_transformation, id_step, "file_extention", extension );
    rep.saveStepAttribute( id_transformation, id_step, "file_append", fileAppended );
    rep.saveStepAttribute( id_transformation, id_step, "file_split", splitEvery );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_stepnr", stepNrInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_partnr", partNrInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_date", dateInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_time", timeInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "create_parent_folder", createparentfolder );
    rep.saveStepAttribute( id_transformation, id_step, "DoNotOpenNewFileInit", DoNotOpenNewFileInit );

    // 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 17
Source File: InsertUpdateMeta.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, "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 );
  }
}
 
Example 18
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 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: DimensionLookupMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  try {
    actualizeWithInjectedValues();
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "commit", commitSize );
    rep.saveStepAttribute( id_transformation, id_step, "update", update );

    for ( int i = 0; i < keyStream.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "lookup_key_name", keyStream[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "lookup_key_field", keyLookup[i] );
    }

    rep.saveStepAttribute( id_transformation, id_step, "date_name", dateField );
    rep.saveStepAttribute( id_transformation, id_step, "date_from", dateFrom );
    rep.saveStepAttribute( id_transformation, id_step, "date_to", dateTo );

    if ( fieldStream != null ) {
      for ( int i = 0; i < fieldStream.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldStream[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_lookup", fieldLookup[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_update", getUpdateTypeCode( update,
            fieldUpdate[i] ) );
      }
    }

    rep.saveStepAttribute( id_transformation, id_step, "return_name", keyField );
    rep.saveStepAttribute( id_transformation, id_step, "return_rename", keyRename );
    rep.saveStepAttribute( id_transformation, id_step, "creation_method", techKeyCreation );

    // For the moment still save 'use_autoinc' for backwards compatibility
    // (Sven Boden).
    rep.saveStepAttribute( id_transformation, id_step, "use_autoinc", autoIncrement );
    rep.saveStepAttribute( id_transformation, id_step, "version_field", versionField );

    rep.saveStepAttribute( id_transformation, id_step, "sequence", sequenceName );
    rep.saveStepAttribute( id_transformation, id_step, "min_year", minYear );
    rep.saveStepAttribute( id_transformation, id_step, "max_year", maxYear );

    rep.saveStepAttribute( id_transformation, id_step, "cache_size", cacheSize );
    rep.saveStepAttribute( id_transformation, id_step, "preload_cache", preloadingCache );
    rep.saveStepAttribute( id_transformation, id_step, "useBatch", useBatchUpdate );

    rep.saveStepAttribute( id_transformation, id_step, "use_start_date_alternative", usingStartDateAlternative );
    rep.saveStepAttribute( id_transformation, id_step, "start_date_alternative", getStartDateAlternativeCode(
        startDateAlternative ) );
    rep.saveStepAttribute( id_transformation, id_step, "start_date_field_name", startDateFieldName );

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

  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG,
        "DimensionLookupMeta.Exception.UnableToLoadDimensionLookupInfoFromRepository" ), dbe );
  }
}