You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hello,
I am faced with a 'java.lang.NullPointerException' when I set a null value in a (nullable) field a table of my database.
Here's the scenario:
An external source (my tFixedFlowInput in my example) can have a value and then change the value in base, or have no value, and in this case, I set the previous value to the base.
This works, except in the case I have no value in either the external source, or in the database (null and null). In this case, I have a 'java.lang.NullPointerException' on the line corresponding to the value of the field in the TMap:
temp_nva_out_tmp.isOK = !Relational.ISNULL(IN.isOK) ? 1 : temp_nva_in.isOK;
I do not understand how the assignment of the null can generate
'java.lang.NullPointerException'. If I replace temp_nva_in.isOK by 'null', it works correctly.
Thanks for ideas,
Last edited by NicolasTT (2012-04-19 11:38:35)
Offline

My expression is :
!Relational.ISNULL(in.isOK) ? 1 : temp_nva_in.isOK
is the Tmap.
In the java code :
// # Output table : 'temp_nva_out'
temp_nva_out_tmp.uid = in.uid;
temp_nva_out_tmp.isOK = !Relational.ISNULL(in.isOK) ? 1 : temp_nva_in.isOK;
temp_nva_out = temp_nva_out_tmp;Offline

Hi
It seems that there are null values in temp_nva_in.isOK.
You can put a tJavaRow between the input component and tMap and type code as follow.
if(input_row.isOk==null) output_row.isOk = 0;
Regards,
Pedro
Offline

temp_nva_out_tmp.isOK = !Relational.ISNULL(in.isOK) ? new Integer( 1 ) : temp_nva_in.isOK;
works and
temp_nva_out_tmp.isOK = !Relational.ISNULL(in.isOK) ? 1 : temp_nva_in.isOK;
doesn't work.
I don't understand why. Thanks if you could explain me?
Offline
Pages: 1