Thank you very much for your message.

We have a pending feature request that would allow for configuring case
sensitivity of column access in methods like Table.field() and various
others:
https://github.com/jOOQ/jOOQ/issues/2656

Unfortunately, this is non trivial to implement and only benefits a
minority of users, which is why this hasn't been a priority so far.

>From how I understand your situation, you want to access a well-known
column that you expect to be present on all/most tables. What you could do
is generate an auxiliary method on all tables, which would give access to
an individual table's ID column:
https://www.jooq.org/doc/latest/manual/code-generation/codegen-custom-code/

In order to affect the field name as referenced in those createField()
method calls, that's another feature request we haven't implemented yet:
Column mapping in the code generator:
https://github.com/jOOQ/jOOQ/issues/2949

Another solution, however, would be to override the jOOQ-meta database
implementation that provides ColumnDefinitions to the code generator and
patch the column names there to be consistent. Of course, all of this means
you have to turn off quoting of identifiers at runtime.

I hope this helps,
Lukas

On Fri, Apr 26, 2019 at 11:36 AM <raru...@gmail.com> wrote:

> I'm working with a legacy database and I'd rather not rename database
> fields. Annoyingly, the names aren't consistent. Some tables have a column
> ID, others id. I want to pass some sort parameter at run time to queries
> and Table.field is case-sensitive.
>
> I looked at generator/matcher strategies and there doesn't seem to be any
> way to create table fields with lowercased name when createField is called.
> it seems you can just affect the way the java variables names.
>
> For now I just created my own field method that iterates through the table
> fields and checks after lowercasing.
>
> 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 jooq-user+unsubscr...@googlegroups.com.
> 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 jooq-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to