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
Highlighted
Six Stars

Re: Identity transform tjavarow, reflection fields

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

View solution in original post


All Replies
Highlighted
Six Stars

Re: Identity transform tjavarow, reflection fields

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

View solution in original post

2019 GARTNER 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

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads