有没有办法在 JOOQ 中查询 ltrees?

Is there a way to query ltrees in JOOQ?

是否有任何扩展允许我在 JOOQ 中使用 Postgres ltrees 而无需使用原始 SQL?

有没有办法自己做一个?

您必须实施自定义数据类型绑定(org.jooq.Binding) and apply that to your generated code: https://www.jooq.org/doc/latest/manual/code-generation/custom-data-type-bindings

A Binding 允许您告诉 jOOQ 如何:

  • 为其生成 SQL(在您的情况下可能类似于 ?::ltree
  • 将您的数据类型绑定到 JDBC
    • PreparedStatement
    • SQLOutput(可选,当你的类型包含在UDT中时,目前只在Oracle中)
  • 阅读自JDBC
    • ResultSet
    • CallableStatement(可选,当您从函数 OUT 参数中获取它时)
    • SQLInput(可选,当你的类型包含在UDT中时,目前仅在Oracle中)