I would like to know about writing Objects to a CSV using camel bindy,But my class has a user defined datatypes.I see bindy source code, gives exception for the data types other than which are predefined,Any option in bindy for doing like this.If @Link could help here ? Thank you :)
here is my class
@CsvRecord
Public class Myclass{
@DataField(pos = 1)
private RefClass refOne;
@DataField(pos = 2)
private String createdOn;
}
public class RefClass{
private RefClassTwo refTwo;
private String createdBy;
}
@Link can help to encapsulate two related fiends on a separate class. So, for example for the CSV
Order,Name,Surname
1,Frank,Smith
You could do something like this
For a full example of @Link check this unit test from the camel bindy component tests using this complex model
If you want to get information from one field of the csv to more than one field types in your classes use bindy to parse the information in a String
and afterwards use a processor in your route, parse the content of position 1 and generate the datatypes you want.