What I'm trying to figure out is how exactly to use the VisitListener. I know how to globally register ExecuteListener, for each executed query I can check if it's UPDATE or INSERT, but then I don't know how to actually use the VisitListener to apply it to the Query i get from ExecuteContext. So far I've just created VisitListener bean in spring context and it automagically started to work for all queries, but I'd prefer it to only be executed for queries selected in ExecuteListener.
In the blog I've found only:
DSLContext restricted = DSL.using(
configuration.derive(
DefaultVisitListenerProvider.providers(
new AccountIDFilter(1, 2)
)
)
);
restricted.fetch(ACCOUNTS)
But I don't really wan't to execute the query manually in the ExecuteListener, I just want to somehow inspect it using the VisitListener.