I'm trying to implement some application level data triggers that will replace existing DB triggers. These are very simple triggers defined by "when field F1 is updated in table T1 do X". I use JOOQ for persistence layer, triggers are implemented as ExecuteListener.
I'm overriding executeEnd()
, and getting the Query
object from the context. I can see that the implementation - UpdateQueryImpl
(for update) has a very convenient updateMap, that I could potentially examine in order to find which fields changed and what is the new value. However I couldn't find any public method to access it.
Of course I could try to parse the SQL string but this seems much more error prone. And I'm trying to avoid using reflection unless I really have to, for all the obvious reasons.
Any other ideas?
I use Jooq version 3.10.8, DB is postgres 9.6