Hello,

I'm with Igor here and agree that changing the database schema because of
restrictions imposed by a client library tends to be overkill, especially
in legacy environments.

jOOQ should generally be able to map to arbitrary columns, also when
case-sensitivity is involved. The problem here is really the default naming
strategy that is shipped with jOOQ. We're thinking about replacing the
default (which turns UNDERSCORE_STYLE_NAMING into PascalCasing and
camelCasing) by a more useful one that keeps all identifiers as they are in
the database.

Another option, of course, would be to have the code generator generate JPA
@Column annotations, which will document the original column names as in
the database. That way, the POJO getter / setter names can vary
independently.

Cheers
Lukas



2014-09-08 18:42 GMT+02:00 Igor Katrayev <[email protected]>:

> Hello Josh,
>
> Thank you for the reply. Going to a different naming convention for our
> database would be overkill as it was setup Java style names for database
> objects.
>
> I traced the code to check how jooq maps the field names on runtime and it
> seams the problem might be that when I am generating Java objects from the
> database model I am using my own name converted (see attached). May be I
> need to embed my converter on runtime somehow as well. That's all I need.
>
> I am moving from my own ORM implementation to jooq that has happen to have
> similar ideology. Before I was using hibernate and tried to use iBatis.
>
> Igor.
>
>
>
> On Monday, September 8, 2014 5:31:00 AM UTC-8, Josh Padnick wrote:
>>
>> Hi Lukas and Igor,
>>
>> The filtered post was from me, accidentally posting from a different
>> Google login.  My second time hit by Google spam filters!
>>
>> Anyway, to add to what Lukas said, we ran into this exact issue with
>> Postgres and jOOQ, and I actually see this is a Postgres limitation, not a
>> jOOQ issue. Basically, Postgres will automatically lower case any
>> identifier name (like a field name or table name) unless it's surrounded by
>> quotes.  See http://stackoverflow.com/questions/20878932/are-
>> postgresql-column-names-case-sensitive.
>>
>> Having to surround every field name with quotes for the life of your
>> application is needlessly cumbersome.  The solution we took is to just
>> switch to use underscored identifiers. So, your "htmlSummary" would become
>> "html_summary".
>>
>> Josh
>>
>> On Monday, September 8, 2014 1:59:12 AM UTC-7, Lukas Eder wrote:
>>>
>>> Hello,
>>>
>>> Unfortunately, Google Groups has spam-filtered and eaten a reply by
>>> someone, and I cannot retrieve it. Please, if you sent an e-mail to this
>>> thread, can you re-send it?
>>>
>>> Thanks,
>>> 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.
>

-- 
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.

Reply via email to