Hi Maxim

> We are using jOOQ library only to build SQL queries. We are using
> Spring to fetch data from database, we pass built SQL query to
> JdbcTemplate.

Yes, I have seen this use case before on Stack Overflow:
http://stackoverflow.com/questions/4474365/jooq-and-spring

It looks like quite an interesting integration... How's the general
experience you're making with that integration? Is there any
functionality missing, or some room for improvement? For instance, I
can see that you're using named parameters, which is a Spring feature,
not a JDBC one. Is the current jOOQ API suited for this use-case, or
is there potential for improvement, such as a Factory.param(String
parameterName) method?

> We can't use code generated by schema, because one of our use cases is
> to allow querying user defined tables.

This is an open feature request, specifically for the Postgres database:
https://sourceforge.net/apps/trac/jooq/ticket/332

> Context usage example from our system is http://pastebin.com/bvatSuZC
>
> as result we get query:
> select "p".id_object, "p".ptype, "p".pvalue, "ug".depth from
> (user_groups(:requesterUserId)) as "ug" join (permissions) as "p" on
> ("ug".id_subject = "p".id_subject and "ug".subject_type =
> "p".subject_type)

Unfortunately, the way you're using plain SQL tables right now, I
don't see how this could be improved, without fixing this first:
https://sourceforge.net/apps/trac/jooq/ticket/836

I'll expect a fix for this issue by the beginning of next week,
though. I'll know more by tomorrow. In the mean time, you might be
able to work around this issue by writing something like this:

    .from("permissions as p")
    .join("user_groups(:requesterUserId) as ug")

Cheers
Lukas

Reply via email to