One Star

Problems converting Integer to short -- Java

Hello,
I am trying to convert an integer to a "short" value, using following expression in Tmap:
Relational.ISNULL(row22.Hijos)?null:row22.Hijos.equals("null")?nullSmiley SadShort)row22.Hijos
However, I receive message "Cannot convert from Integer to short".
I believe the syntax to be correct, given that the error message reflects what I am trying to do. I can confirm that source field is of type Integer, and target is of type short.
Any ideas as to why this might be happening?
3 REPLIES
Seventeen Stars

Re: Problems converting Integer to short -- Java

hi
try shortValue() method !
regards
laurent
One Star

Re: Problems converting Integer to short -- Java

Hi Laurent,
That doesn't seem to work,
I tried mapping of "shortValue(row72.CountGrupo)", but received following message:
The method shortValue(Integer) is undefined for the type PhoneData
Any suggestions?
One Star

Re: Problems converting Integer to short -- Java

try
short(row1.field_name)
or try new BigDecimal(row1.field_name).shortValue()