2014-02-19 13:24 GMT+01:00 Ben Hood <[email protected]>:

> On Wed, Feb 19, 2014 at 8:38 AM, Lukas Eder <[email protected]> wrote:
> > Yes, it would. The linked manual page also does this (note the call to
> > queryPartsLength() == 1):
>
> OK, so queryPartsLength() would probably do the trick in my case.
>
> > Yes, if you want more sophistication, you'll probably wind up with option
> > (1)
>
> Is there any way to specify the visitor on a per query basis? Right
> now it looks like the visitor instance gets attached to the global
> Configuration. Or is that a 3.2.x-ism (I'm still on 3.2.x due to a CI
> dependency on maven central)?


You can derive a new Configuration from your existing one and use that on a
per-query basis. E.g.

DSL.using(theGlobalConfig.derive(newVisitListenerProvider))
   .select(...)
   .from(...)


See also:
http://www.jooq.org/javadoc/latest/org/jooq/Configuration.html#derive(org.jooq.VisitListenerProvider..
.)

Note that derive replaces any VisitListenerProviders the original
Configuration might already have. If you want to merge two listener
configurations, you'll have to handle that explicitly.

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

Reply via email to