nurkiewicz / spring-data-jdbc-repository

Spring Data JDBC generic DAO implementation
275 stars 151 forks source link

the developer must to write mapping,it's not convenient #29

Open wodezhh789 opened 8 years ago

ezgitek commented 7 years ago

I agree (if you meant not instead of to). But, you could use this if your variable names and column names are the same (e.g. columnName -> COLUMNNAME also works).

Just write

BeanPropertyRowMapper<Entry> bprm = new BeanPropertyRowMapper<Entry>(Entry.class);
            return bprm.mapRow(rs, p); 

in MapRow function. BeanPropertyRowMapper is under springframework.jdbc.core.

Is there a similar way for the unmapping, except Java reflection? (I'm thinking about BeanMapper, but it is not that reliable)