My problem is that I don't like this code generation thing jOOQ does at all since I'm yet to see an example with it properly set up in multiple profiles, also don't like connecting to the database as part of my build. It's overall quite a nasty set-up I don't to spend a morning doing to realise is very horrible and I don't want it in the project.
You're missing out on a ton of awesome jOOQ features if you're going this way. See this very interesting discussion about the rationale of why having a DB-connection in the build isn't that bad:
In any case, don't get frustrated too quickly. There are a couple of reasons why things have been done the way they are. DSL.fieldByName()
creates a case-sensitive column. If you provide a lower-case "inclusive_test"
column, then jOOQ will render the name with quotes and in lower case, by default.
You have several options:
- Consistently name your MySQL and H2 tables / columns, explicitly specifying the case. E.g.
`inclusive_test`
in MySQL and"inclusive_test"
in H2. - Use jOOQ's Settings to override the rendering behaviour. As I said, by default, jOOQ renders everything with quotes. You can override this by specifying
RenderNameStyle.AS_IS
- Use
DSL.field()
instead ofDSL.fieldByName()
instead. It will allow you to keep full control of your SQL string.
By the way, I think we'll change the manual to suggest using DSL.field()
instead of DSL.fieldByName()
to new users. This whole case-sensitivity has been causing too many issues in the past. This will be done with Issue #3218