Hi Rob,
Thanks a lot for your comment.
Yes indeed, better examples would be very helpful. This issue, for example, is overdue (recursive CTE example):
It will be a very good opportunity to put a disclaimer in the manual. jOOQ supports CTE, and does so very well in case your query is dynamic or vendor agnostic (I'm just now implementing a fix that can push up nested CTE to the top level of a SELECT:
https://github.com/jOOQ/jOOQ/issues/3175, and even of any DML statement:
https://github.com/jOOQ/jOOQ/issues/11586, in case a dialect doesn't support nesting, e.g. SQL Server). But that doesn't mean that jOOQ has to be used for *everything*. When I look at your examples, I wonder if a mix between using jOOQ for the dynamic/fast-changing parts and a SQL view or table valued function (TVF) for the static parts could have been an option. Both views and TVFs are supported by jOOQ's code generator and are heavily underappreciated.
Given that I don't think jOOQ will be able to add enough type safety to CTE (or derived table) building (there's
https://github.com/jOOQ/jOOQ/issues/1969, but it will just add some type safety, not a great user experience, I think), I think moving some logic into views or TVFs is often an option worth considering.
Regarding this particular message:
Is this Scala or Groovy? I've considered adding a @Deprecated annotation on Field.equals(). There's already Javadoc warning of this API misuse, but deprecation warnings might be even better. Would that have helped in your case?