Search code examples
javajdbcspring-integrationspring-jdbcoracle-aq

Adt message converters - INTEGERS come as nulls


I am using following configuration for handling OracleAQ with adt payload...

<bean id="messageConverter"
   class="org.springframework.data.jdbc.jms.support.converter.oracle.MappingAdtMessageConverter">
  <constructor-arg>
    <bean class="org.springframework.data.jdbc.jms.support.oracle.StructDatumMapper"> 
      <constructor-arg index="0" value="MY_QUEUE"/>
      <constructor-arg index="1" value="MyMappedClass"/>
    </bean>
  </constructor-arg>
</bean>

the problem is that after dequeuing I am getting on java side null values for fields with INTEGERs and non null values for other fields.

MyMappedClass@649fe46f[
  id=<null>
  id2=<null>
  time=2013-02-22 14:57:11.0
  user=LUKAS
]

In queue table these values exists as not nulls.

What can be the reason. I expected bad mappings, but I don't see anything wrong there. Those fields are mapped as Types.INTEGER.

Do you have maybe idea what can be the reason?


Solution

  • Finally I've found that there are mistakes in generated mapping files. For Long field I had Integer setter. That was the reason why reflection api during conversion process regarded those fields as non writeable. So it was not library version or configuration problem.