且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从JOOQ解析器结果获取表/列元数据

更新时间:2023-02-26 10:23:38

从jOOQ 3.11开始,可用于访问内部表达式树的SPI是

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.

但是,有很多手动管道需要完成.例如,VisitListener仅将A.BAZ作为列引用,而没有直接知道A是重命名的表BAR.当您访问BAR A表达式时,您将必须跟踪自己的重命名.

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.