Hi Gérald,

The documentation that you linked to has a meaningful example,
dereferencing the ID column from the aliased AUTHOR table: a.ID.

The reason why generated artefacts (table names, column names) are
uppercased is the simple fact that jOOQ is slightly biased towards Oracle,
where case-insensitive object names are all upper-cased. It feels natural
for an Oracle-centric developer to use upper-cased table and column names.
Java naming conventions are secondary, here, because camel-casing table and
column names by default doesn't feel natural.

You may, however, change this behaviour by specifying a generator strategy,
or a matcher strategy:
-
http://www.jooq.org/doc/3.2/manual/code-generation/codegen-generatorstrategy/
-
http://www.jooq.org/doc/3.2/manual/code-generation/codegen-matcherstrategy/

Cheers
Lukas


2013/11/9 <[email protected]>

> It was a silly question, I didn't realize that Person.ID was an instance
> field not a class field. It should be named Person.id. The code generator
> doesn't respect standard Java naming rules (with default settings), and led
> me to misunderstand the code.
>
> Gérald
>
> Le vendredi 8 novembre 2013 16:59:54 UTC+1, [email protected] a écrit :
>
>> Hello,
>>
>> I'd like to write something like
>> select
>>     b.id,b.title,
>>     a.id,a.name,
>>     r.id,r.name
>> from book b
>> join person a on a.id=b.author_id
>> left join person r on r.id=b.reviewer_id
>>
>> I found the documentation http://www.jooq.org/doc/3.2/
>> manual/sql-building/table-expressions/aliased-tables/ and wrote
>> Book b = BOOK.as("b");
>> Person a = PERSON.as("a");
>> Person r = PERSON.as("r");
>> create.select(
>>     b.field("ID"),b.field("TITLE"),
>>     a.field("ID"),a.field("NAME"),
>>     r.field("ID"),r.field("NAME")
>>     ).from(b)
>>     .join(a).on(a.ID.equal(b.AUTHOR_ID))
>>     .leftJoin(r).on(r.ID.equal(b.REVIEWER_ID))
>>
>> But then fields are not type safe,  and column names are just strings. Is
>> it possible to write something like:
>> create.select(
>>     b.id,b.title,
>>     a.id,a.name,
>>     r.id,r.name
>>     ).from(b)
>>     .join(a).on(a.ID.equal(b.AUTHOR_ID))
>>     .leftJoin(r).on(r.ID.equal(b.REVIEWER_ID))
>>
>> Thanks,
>> Gérald
>>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to