Get Table/column Metadata From Jooq Parser Result
Using the JOOQ parser API, I'm able to parse the following query and get the parameters map from the resulting Query object. From this, I can tell that there is one parameter, and
Solution 1:
As of jOOQ 3.11, the SPI that can be used to access the internal expression tree is the VisitListener
SPI, which you have to attach to your context.configuration()
prior to parsing. It will then be invoked whenever you traverse that expression tree, e.g. on your query.getParams()
call.
However, there's quite a bit of manual plumbing that needs to be done. For example, the VisitListener
will only see A.BAZ
as a column reference without knowing directly that A
is the renamed table BAR
. You will have to keep track of such renaming yourself when you visit the BAR A
expression.
Post a Comment for "Get Table/column Metadata From Jooq Parser Result"