I tried the flag, and it does not seem to work. It had been attributed as experimental anyway.
Concerning my db identifiers and the resulting class names - yep, I could use double quotes. That would imply I'd have to pass all my automatically generated scripts through another batch edit layer, and weighing the potential error source I would also introduce against the benefit makes me think I might be better off just sticking to plain unmodified uppercase and focusing on more crucial tasks. One of which is another thing you might be able to give me a hint about. I'm using JavaFX via FXML for the client, and it's a plain desktop application. The database is strictly local, and I'm using H2 in embedded mode. The next thing I'm pondering about is whether I should stick with jOOQ alone to drive the JavaFX controls efficiently and elegantly, or I should also use DataFX or similar. Also, I'm not familiar with DataFX yet and thus don't know how well it would work in conjunction with jOOQ. Any insights/hints on that one? Cheers, Carsten 2016-07-16 9:04 GMT+02:00 Lukas Eder <[email protected]>: > Huh, interesting, I wasn't aware of that flag. But if you want to stay on > the safe side, it's probably best to make all identifiers in your database > case-sensitive by using double quotes. I think case-sensitivity is an all > or nothing thing, otherwise there will always be forgotten cases / edge > cases, etc. > > Cheers, > Lukas > > 2016-07-16 1:37 GMT+02:00 Carsten Langsdorf <[email protected]>: > >> Hi Lukas, >> >> yup, that was the issue. Thanks again. >> >> I had completely forgotten about the automatic conversion, but now I >> found out it can be disabled by appending ;DATABASE_TO_UPPER=FALSE >> <http://www.h2database.com/javadoc/org/h2/engine/DbSettings.html#DATABASE_TO_UPPER> >> to >> the database URL. >> >> Cheers, >> Carsten >> >> 2016-07-15 18:43 GMT+02:00 Lukas Eder <[email protected]>: >> >>> Hi Carsten, >>> >>> Are those tables in your database really case sensitive? In other words, >>> do you do: >>> >>> CREATE TABLE VAccount ( ... ); >>> >>> >>> or >>> >>> CREATE TABLE "VAccount" ( ... ); >>> >>> >>> Because in the first case, the H2 database will already lose your >>> upper/lower case information and report them to jOOQ's code generator in >>> all upper case. That would explain the KeepNamesGeneratorStrategy behaviour. >>> >>> Hope this helps, >>> Lukas >>> >>> 2016-07-15 1:11 GMT+02:00 Carsten Langsdorf <[email protected] >>> >: >>> >>>> Hi everyone, >>>> >>>> I'm currently digging into jOOQ's code generation feature, and I'm >>>> running into issues with generated names. >>>> Over the years, I have developed my own naming pattern, and thus I >>>> would like to preserve names as they are, if possible. I will use some >>>> table and view names to explain the situation and the approaches I already >>>> have taken. >>>> >>>> Among others, I got the following tables and corresponding views in an >>>> H2 database: >>>> >>>> Account >>>> Server >>>> ServerAccount >>>> >>>> V_Account >>>> V_Server >>>> V_ServerAccount >>>> >>>> And I'm trying to generate code for those while completely preserving >>>> the names. >>>> >>>> Here are the names I get from a plain generation run without any name >>>> manipulation: >>>> >>>> Account >>>> Server >>>> Serveraccount >>>> >>>> VAccount >>>> VServer >>>> VServeraccount >>>> >>>> >>>> That's not really what I wanted. A peek into the documentation led me >>>> to approach #1: >>>> >>>> <generator> >>>> <!-- ... --> >>>> <strategy> >>>> <name>org.jooq.util.KeepNamesGeneratorStrategy</name> >>>> </strategy> >>>> </generator> >>>> >>>> >>>> (Omitting the top level <configuration> tag and the <jdbc> section) >>>> >>>> Resulting names: >>>> >>>> ACCOUNT >>>> SERVER >>>> SERVERACCOUNT >>>> >>>> V_ACCOUNT >>>> V_SERVER >>>> V_SERVERACCOUNT >>>> >>>> >>>> Again, not quite. Digging further took me to approach #2: >>>> >>>> <generator> >>>> <!-- ... --> >>>> <strategy> >>>> <matchers> >>>> <tables> >>>> <table> >>>> <!-- no expression on purpose --> >>>> <tableClass> >>>> <transform>AS_IS</transform> >>>> </tableClass> >>>> </table> >>>> </tables> >>>> </matchers> >>>> </strategy> >>>> </generator> >>>> >>>> >>>> Result: Same as above. >>>> >>>> Approach #3: >>>> >>>> <generator> >>>> <!-- ... --> >>>> <strategy> >>>> <matchers> >>>> <tables> >>>> <table> >>>> <expression>(\w)+</expression> >>>> <tableClass> >>>> <expression>$0</expression> >>>> </tableClass> >>>> </table> >>>> </tables> >>>> </matchers> >>>> </strategy> >>>> </generator> >>>> >>>> >>>> Again, the same result. >>>> >>>> Finally, I tried to use AsInDatabaseStrategy, as defined in the >>>> documentation: >>>> >>>> <generator> >>>> <!-- ... --> >>>> <strategy> >>>> <name>org.oddloot.db.AsInDatabaseStrategy</name> >>>> </strategy> >>>> </generator> >>>> >>>> >>>> And this took me back to >>>> >>>> Account >>>> Server >>>> Serveraccount >>>> >>>> VAccount >>>> VServer >>>> VServeraccount >>>> >>>> >>>> Of course, all these results are pretty much usable - only not quite >>>> what I wanted. >>>> >>>> Am I doing something fundamentally wrong here, or just missing >>>> something? >>>> >>>> Any suggestions/hints really appreciated. >>>> >>>> Cheers, >>>> Carsten >>>> >>>> -- >>>> 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 a topic in the >>> Google Groups "jOOQ User Group" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/jooq-user/cncowd9o_fc/unsubscribe. >>> To unsubscribe from this group and all its topics, 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. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "jOOQ User Group" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/jooq-user/cncowd9o_fc/unsubscribe. > To unsubscribe from this group and all its topics, 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.
