You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by DianaAZ <di...@gmail.com> on 2016/05/18 12:34:27 UTC

camel-bindy not binding well when first column value is null

I have issues when first column value in a row is null. I have something like
this:@CsvRecord(separator = "\\t", skipFirstLine = true)public class
Inventory {    @DataField(pos = 1, required=false)    private String vendor;   
@DataField(pos = 2, required=false)    private String sku;    @DataField(pos
= 3, required=false)    private Integer stock;}And if I have a file with a
content like this (Note: "->" is would be a tab
representation)VENDOR->SKU->STOCKVendor1->123->5Vendor1->->10The binder maps
all columns well, to something like this:[{    vendor: "Vendor1",    sku:
"123",    stock: 5},{    vendor: "Vendor1",    sku: null,    stock: 10}]But
when the first column is null, the column 2 value (sku) is assigned by the
binder to the column 1 binded attribute "vendor", and the column 3 value is
assinged to the column 2 binded attribute (sku), and the the actual
attribute binded to column 3 stays
null:VENDOR->SKU->STOCKnull->123->5Vendor1->166->10Produces this mapping:[{   
vendor: "123",    sku: "5",    stock: null},{    vendor: "Vendor1",    sku:
"166",    stock: 10}]I'm using camel 2.11.1, and so is the camel-bindy and
camel-csv dependencies.I tried to search for this issue, and couldn't find
it. Right now I'm moving along different versions of the binder, to see if
can get it working. But I'd like to know if there is something I should set
(annotation, property) to prevent this behavior, or if it was an known issue
that was already solved in later version of the one I'm using.Thanks in
advance! 



--
View this message in context: http://camel.465427.n5.nabble.com/camel-bindy-not-binding-well-when-first-column-value-is-null-tp5782749.html
Sent from the Camel - Users mailing list archive at Nabble.com.