42BV / CSVeed

Light-weight, easy-to-use Java-based CSV utility
Apache License 2.0
100 stars 22 forks source link

Row Data is not mapping to the bean. #48

Open smrutiranjanbehera opened 10 years ago

smrutiranjanbehera commented 10 years ago

I was trying to read the csv and try to map the column to the java POJO's but Its not mapping the. I am using csveed-0.4.1 version.

Bean Class

public class ProductSpecificationBean { private String tpnb;

public String getTpnb()
{
    return tpnb;
}

public void setTpnb(String tpnb) { this.tpnb = tpnb; } }

csvFile Data

tpnb,event_name 254043,abcdef

Mapper Class

CsvClient csvClient = new CsvClientImpl(reader1, new BeanInstructionsImpl( ProductSpecificationBean.class)).setMapper(ColumnNameMapper.class).mapColumnNameToProperty("tpnb", "tpnb");

OUT.info("ROW::::" + csvClient.readRow()); OUT.info("BEAN: "+csvClient.readBean());

MyResult

INFO - ROW::::org.csveed.row.RowImpl@5a2470ee INFO - BEAN: null

Please help me to get resolve this issue as soon as possible.