I'm trying to have some inheritance in using bindy csv Dataformat (Camel 2.13.1) I have an abstract class and two concrete classe, each one inherit the base class.
ex
@CsvRecord(separator=";",generateHeaderColumns=true,skipFirstLine=true)
public abstract class AbstractBaseFormat {
@DataField(columnName="FIELD1",pos=1)
protected String field1;
@DataField(columnName="FIELD2",pos=2)
protected String field2;
// getter/setter
}
public class Format1 extends AbstractBaseFormat {
@DataField(columnName="FIELD3",pos=3)
private String field3;
// getter / setter
}
public class Format2 extends AbstractBaseFormat {
@DataField(columnName="FIELD3",pos=3)
private Long field3;
// getter / setter
}
When i use concrete classe in my route , camel throw an error
java.lang.IllegalArgumentException: The separator has not been defined in the annotation @CsvRecord or not instantiated during initModel. must be specified
Ok, the @CsvRecord annotation is on the abstract class and is not recognized by the Bindy Factory.
But if i put this annotation on each concrete class , i get another exception as Bindy didn't find the first field (pos = 1).
Can i use this kind of model with Bindy csv Dataformat ?