public synchronized ObjectId insertTransformationPartitionSchema( ObjectId id_transformation,
    ObjectId id_partition_schema ) throws KettleException {
    ObjectId id = connectionDelegate.getNextTransformationPartitionSchemaID();

    RowMetaAndData table = new RowMetaAndData();

    table.addValue( new ValueMetaInteger(
      KettleDatabaseRepository.FIELD_TRANS_PARTITION_SCHEMA_ID_TRANS_PARTITION_SCHEMA ), id );
    table.addValue(
      new ValueMetaInteger(
        KettleDatabaseRepository.FIELD_TRANS_PARTITION_SCHEMA_ID_TRANSFORMATION ), id_transformation );
    table.addValue(
      new ValueMetaInteger(
        KettleDatabaseRepository.FIELD_TRANS_PARTITION_SCHEMA_ID_PARTITION_SCHEMA ), id_partition_schema );

    connectionDelegate.insertTableRow( KettleDatabaseRepository.TABLE_R_TRANS_PARTITION_SCHEMA, table );

    return id;
  }
@Test
  public void testInsertTransformationPartitionSchema() throws KettleException {
    ArgumentCaptor<String> argumentTableName = ArgumentCaptor.forClass( String.class );
    ArgumentCaptor<RowMetaAndData> argumentTableData = ArgumentCaptor.forClass( RowMetaAndData.class );
    doNothing().when( repo.connectionDelegate ).insertTableRow( argumentTableName.capture(), argumentTableData.capture() );
    doReturn( new LongObjectId( 456 ) ).when( repo.connectionDelegate ).getNextTransformationPartitionSchemaID();

    ObjectId result = repo.insertTransformationPartitionSchema( new LongObjectId( 147 ), new LongObjectId( 258 ) );

    RowMetaAndData insertRecord = argumentTableData.getValue();
    assertEquals( KettleDatabaseRepository.TABLE_R_TRANS_PARTITION_SCHEMA, argumentTableName.getValue() );
    assertEquals( 3, insertRecord.size() );
    assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 0 ).getType() );
    assertEquals( KettleDatabaseRepository.FIELD_TRANS_PARTITION_SCHEMA_ID_TRANS_PARTITION_SCHEMA, insertRecord.getValueMeta( 0 ).getName() );
    assertEquals( Long.valueOf( 456 ), insertRecord.getInteger( 0 ) );
    assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 1 ).getType() );
    assertEquals( KettleDatabaseRepository.FIELD_TRANS_PARTITION_SCHEMA_ID_TRANSFORMATION, insertRecord.getValueMeta( 1 ).getName() );
    assertEquals( Long.valueOf( 147 ), insertRecord.getInteger( 1 ) );
    assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 2 ).getType() );
    assertEquals( KettleDatabaseRepository.FIELD_TRANS_PARTITION_SCHEMA_ID_PARTITION_SCHEMA, insertRecord.getValueMeta( 2 ).getName() );
    assertEquals( Long.valueOf( 258 ), insertRecord.getInteger( 2 ) );
    assertEquals( new LongObjectId( 456 ), result );
  }