Hello, Thank you for your input!
As you expected, this isn't really a bug but a limitation. I can see your point and I've registered an issue to improve this for jOOQ 3.6: https://github.com/jOOQ/jOOQ/issues/3903 The main reason why this wasn't implemented this way (and why probably only few people have brought it up in the past) is because people don't let the JavaBeans naming conventions leak into their databases, i.e. few people actually have case-sensitive "firstName" column names in their databases. What we've observed so far are two conventions in SQL: - ALL_UPPER_CASE (most databases) - PascalCase (T-SQL databases) This is why the current behaviour seems suitable enough to map database conventions to Java. The first column would map to any of these setters: - setALL_UPPER_CASE(...) - ALL_UPPER_CASE(...) - setAllUpperCase(...) // This matches JavaBeans conventions - allUpperCase(...) Adding support for #3903 certainly doesn't hurt, here. If you want to add this sort of behaviour already before jOOQ 3.6, you can implement your own RecordMapper and RecordMapperProvider to replace / enhance the current DefaultRecordMapper: http://www.jooq.org/doc/latest/manual/sql-execution/fetching/pojos-with-recordmapper-provider/ Cheers, Lukas 2015-01-06 23:14 GMT+01:00 Robert DiFalco <[email protected]>: > There seems to be a bug in the field to POJO mapping. Typically, with Java > Beans, if you have a value named "firstName" it will find the setter > "setFirstName". Consider JSON parsing libraries like JSON or GSON. > > Unfortunately, with JOOQ, it will only look for "setfirstName", > "setfirstname", or "setFirstname". It might be a limitation instead of a > bug but it feels like a bug. Personally, I would consider making the first > match be "set" + name.substring(0,1).toUpper() + name.substring(0, > name.length). Then all will be well (and as expected). > > I'm actually surprised this hasn't been a bigger issue with how mature the > JOOQ codebase is. Was there a reason for not adopting the same bean mapping > rules other domains (like JSON) adopt? > > 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/d/optout. > -- 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/d/optout.
