2014-04-28 15:35 GMT+02:00 Garret Wilson <[email protected]>: > On Sunday, April 27, 2014 11:44:26 PM UTC-7, Lukas Eder wrote: >> >> ... >> This is the general name mangling strategy to avoid conflicts when >> someone has all of foo:bar, foo_bar, and foo?bar columns. This was >> implemented in jOOQ 3.3.0: >> https://github.com/jOOQ/jOOQ/issues/2016 >> > > Hmmm... I empathize with the intent, but ... I'm not sure it should be the > default behavior if ease-of-use is the goal. I'd imagine that the type of > conflicts you mention are a tiny minority of cases. I'd recommend changing > all invalid characters to '_' as you *used* to do, and allowing a simple > flag for turning on/off illegal character URI-encoding. >
I'll trade your tiny minority of people that produce collisions with special characters against my tiny minority of people who use special characters in object names more than very occasionally :-) On a more serious note, there is a lot of name mangling and encoding going on, in jOOQ's code generator. Our main goal here is to avoid compilation errors at all costs. Encoding *all* non-Java-identifier characters with an underscore was simply not very robust. Besides, it was just as much a random choice as choosing the "<underscore> <hex-encoding>" format that we have in place now. I'd prefer not to revert this change. The code generator works well and is robust, out-of-the-box. When we implemented the matcher strategies, we wanted to help people override this out-of-the-box behaviour as easily and as powerfully as possible, instead of adding dozens of little (hard-to-test) flags for every use-case. A similar discussion is the one where jOOQ's code generator transforms table names into PascalCase classes, but table references are UPPER_CASED, by default. A default setting that doesn't suit everyone. Again, the matcher strategies help overriding this default in a very generic way. > > >> ... >> Or your own programmatic strategies: >> http://www.jooq.org/doc/latest/manual/code-generation/ >> codegen-generatorstrategy/ >> > > Ooh, that looks promising! Thanks! I'll investigate that immediately. > Yes, I think that would be the best way forward. Cheers Lukas -- 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.
