Identity transform tjavarow, reflection fields

Highlighted
Six Stars

Identity transform tjavarow, reflection fields

I'm trying to just trying to copy input fields to output fields, using tJavarow, and I'm getting the error java.lang.IllegalArgumentException: Can not set boolean field.

This is my code,

        Field[] input_row_f = input_row.getClass().getDeclaredFields();
        Field[] output_row_f = input_row.getClass().getDeclaredFields();

        for (int i = 0; i < input_row_f.length; i++) {
            Field input_field = input_row_f[i];
            Field output_field = output_row_f[i];

            int mod = input_field.getModifiers();
            if (!Modifier.isStatic(mod) && Modifier.isPublic(mod)) {
            
	           output_field.set(output_row, input_field.get(input_row));
	        }
        }

Shouldn't this work?  

I'm not even changing the values from one to the other, and the schema is the same in both directions.


Accepted Solutions
Six Stars

Re: Identity transform tjavarow, reflection fields

Oops, used input_row twice.. it worked after I fixed it

All Replies
Six Stars

Re: Identity transform tjavarow, reflection fields

Oops, used input_row twice.. it worked after I fixed it

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog