Question

If the input data is null, when marshaling using my Bindy model (elToCSV) :

@DataField(pos = 7)  int nbRoom;

and route as follow:

from("direct:start").bean(ELProcessor.class,"myMethod").marshal(elToCSV).to("file:" + outFolder + "?fileName=test.csv");

it sets automatically a 0 and not an empty field into my output.

is there any parameters to define that i've missed ?

thanks

Was it helpful?

Solution

A field with the type int can not be set to null. This is just not possible in Java. Use Integer instead for nbRoom.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top