Hi Dominik, Thanks for your feedback. Yes, we can do better in this area. The most recent and relevant issue is this one: https://github.com/jOOQ/jOOQ/issues/10574. We should offer the expected behaviour out of the box, because the PascalCase or camelCase naming conventions are very popular in SQL Server (unlike e.g. Oracle, PostgreSQL, where snake_case is usually preferred, and for which jOOQ's code generator is optimised).
Issue #10574 aims at fixing this, rather than documenting the status quo. Thanks, Lukas On Thu, Oct 1, 2020 at 11:44 PM '[email protected]' via jOOQ User Group <[email protected]> wrote: > found the solution by applying 2 mandatory options > > <javaBeansGettersAndSetters>true</javaBeansGettersAndSetters> > plus > <fieldMember> > <transform>AS_IS</transform> > <expression>$0</expression> > </fieldMember> > leads to correctly cased method names for getter/setter. > The first one seems to be the feature toggle mentioned in > https://github.com/jOOQ/jOOQ/issues/5354 while the second part provide > the basis by adjust the java member name itself. > If one part is missing, the getter/setter are not correctly cased. > Due to such named/cased getter/setter seems to be wide commonly used, this > may an additional example for the already extensive documentation. > > [email protected] schrieb am Donnerstag, 1. Oktober 2020 um 14:52:35 > UTC+2: > >> >> In my DB (SQL server) there are column names in camelCase. For this I >> would like to generate pojos for which >> a) the field names correspond 1: 1 to the camelCase column names >> b) the getter / setter according to the scheme: >> [get | set] + column names in Pascal Case, i.e. with first char uppercase >> while the rest of the name should remain the same like the column name. >> I guess that's one of the common requirements and the standard case for >> naming getter / setter after the attribute name. >> >> Example: >> Column: activeRevision >> getter getActiveRevision >> setter: setActiveRevision >> >> The field names of the POJO attributes match with the following >> strategy/matchers >> <fieldMember> >> <transform> AS_IS </transform> >> <expression> $ 0 </expression> >> </fieldMember> >> >> But I can't get the names of the getter / setters: >> >> <fieldGetter> >> <transform> AS_IS </transform> >> <expression> get $ 0 </expression> >> </fieldGetter> >> leads to getactiveRevision >> >> <fieldGetter> >> <transform> CAMEL </transform> >> <expression> $ 0 </expression> >> </fieldGetter> >> leads to activerevision (where is the UPPER cases 'R' of revision?) >> >> <fieldGetter> >> <transform> CAMEL </transform> >> <expression> get $ 0 </expression> >> </fieldGetter> >> leads to getactiverevision >> >> How can I achieve that getter / setter getActiveRevision and >> setActiveRevision are generated for a column activeRevision? Do I really >> have to write a custom generator? >> >> Seems to be, that this issue is open since 2013 ? >> https://groups.google.com/g/jooq-user/c/1iy0EdWe_T8 so >> >> kind regards >> Dominik >> > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jooq-user/36ec744f-2449-455e-bdd7-0b7bab9ea3edn%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/36ec744f-2449-455e-bdd7-0b7bab9ea3edn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO51eNt%2B2o%2ByYvXy2We%2B%3DGq7WxMyUKHBnvehnrQHdympVw%40mail.gmail.com.
