Nicolas Hauzaree
Nicolas Hauzaree

Reputation: 743

Camel Bindy return 0 instead of null (empty)

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

Upvotes: 0

Views: 488

Answers (1)

Peter Keller
Peter Keller

Reputation: 7646

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

Upvotes: 1

Related Questions