0

i want to use Bindy to map a List of objects.

For Example I have class x:

@CsvRecord(separator = ",")    
public class User {
    protected List<Skill> skills;
}        
public class Skill {
    protected String name;
}

How can I map skill list from CSV file with the following data:

skill1, skill2, skill3

I tried @oneToMany annotation but it did not work. Also, don't know how many skill will be included in CSV. How can I handle this mapping?

gcw
  • 1,639
  • 1
  • 18
  • 37

1 Answers1

0

I've solved it using beanio as below

 <unmarshal id="convert csv to XML)">
     <beanio id="My list" mapping="MyObject.xml" streamName="ObjectStreamName"/>
    </unmarshal>

Also you can define xml file for mapping.