Hi Lukas,

> The CASE expression is indeed modeled by DSL.decode(), as you can see here:
>
> http://www.jooq.org/doc/3.0/manual/sql-building/column-expressions/case-expressions/
>

"Unfortunately, both case and else are reserved words in Java. jOOQ chose
to use decode() from the Oracle DECODE function, and otherwise(), which
means the same as else."

I think keywords should not be replaced with synonyms, otherwise you are
not mapping SQL to Java, but SQL to a jOOQ-specific QL. I think that even
if it is not as good as having "case()" and "else()", there should be
"case_()" and "else_()". Developers would understand that this is because
of reserved keywords and would not have to analyze the API/documentation to
map their SQL.


We are lucky that Java does not have more reserved keywords, otherwise:
SELECT * FROM BOOK WHERE PUBLISHED_IN = 2011 ORDER BY TITLE
would have been:
create.pickFrom(BOOK).condition(PUBLISHED_IN.sameAs(2011)).sortBy(TITLE)

:)

Cheers,
-Christopher

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