Nice catch! The DefaultRecordMapper implements the same naming assumptions as previously described: http://www.jooq.org/javadoc/latest/org/jooq/impl/DefaultRecordMapper.html
This will have to be fixed in jOOQ 3.3 as well: https://github.com/jOOQ/jOOQ/issues/2929 In the mean time, you will probably have to resort to writing your own RecordMapperProvider to override this behaviour: http://www.jooq.org/doc/3.2/manual/sql-execution/fetching/pojos-with-recordmapper-provider/ Cheers Lukas 2014/1/5 <[email protected]> > Lukas, I found another problem. > > Because I use a custom Generator strategy, which generates > *setPasswordEncrypted() > *for the field *passwordEncrypted* on my *User *entity pojo, the mapping > doesn't work anymore. > > I get the *User* entity using its DAO : *userDao.fetchOne(user.username, > "toto");* > > The record is found. But when Jooq tried to map it to the pojo, using > *mapper().map(record)*, the *setPasswordEncrypted() *setter is not found > so the field stays NULL. Why? Because of the > *Utils#getMatchingSetters()*method, which calls > *StringUtils#toCamelCase(name)*. But : > > *StringUtils.toCamelCase("passwordEncrypted")* returns " > *Passwordencrypted*" so *setPasswordencrypted(*) is searched, but not > *setPasswordEncrypted()*! > > In *Utils#getMatchingSetters()*, maybe you could look for true camel > cased versions too? > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
