我正在使用使用 jOOQ 的“where”功能的洗掉和更新方法:
public static void delete(DSLContext context, Table<? extends Record> table, Condition condition) {
context.delete(table)
.where(condition)
.execute();
}
在 jOOQ 檔案中,它在 DeleteWhereStep - @CheckReturnValue DeleteConditionStep where(Condition var1) 處引發錯誤;
我得到 java: cannot access java.util.concurrent.Flow class file for java.util.concurrent.Flow not found error at the where(condition) point。
我正在使用的版本是 - jooq、jooq-meta、jooq-codegen、jooq-meta-extensions-liquibase:3.15.5
請幫忙。
uj5u.com熱心網友回復:
該錯誤與您的特定查詢無關,而是與您的依賴管理有關。
該類java.util.concurrent.Flow僅添加到 JDK 9,它在 JDK 8 中尚不可用。從 jOOQ 3.15 開始,jOOQ 開源版具有 Java 11 基線,因此直接依賴于 JDK 11 API,包括Flow. 如果您希望繼續使用 Java 8 和 jOOQ 3.15,則需要升級到繼續支持 Java 8 的商業發行版。您可以在此處找到 jOOQ 的 Java 版本支持矩陣:
https ://www.jooq.org /下載/版本
盡管使用了商業版本,但您仍可能意外拉取 jOOQ 開源版依賴項并因此遇到此錯誤的一個常見原因可能與使用第三方依賴項管理框架有關,例如 Spring Boot,它默認為依賴在 jOOQ 開源版上。這篇博客文章解釋了如何解決這個問題: https ://blog.jooq.org/how-to-use-jooqs-commercial-distributions-with-spring-boot/
此外,請確保您在代碼生成設定和運行時都使用了正確的依賴項,如您在手冊的本節中所見。
它說:
<!-- Specify the maven code generator plugin -->
<!-- Use org.jooq for the Open Source Edition
org.jooq.pro for commercial editions with Java 17 support,
org.jooq.pro-java-11 for commercial editions with Java 11 support,
org.jooq.pro-java-8 for commercial editions with Java 8 support,
org.jooq.trial for the free trial edition with Java 17 support,
org.jooq.trial-java-11 for the free trial edition with Java 11 support,
org.jooq.trial-java-8 for the free trial edition with Java 8 support
Note: Only the Open Source Edition is hosted on Maven Central.
Import the others manually from your distribution -->
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.16.5</version>
所以你需要選擇:
<groupId>org.jooq.pro-java-8</groupId>如果您已經獲得許可<groupId>org.jooq.trial-java-8</groupId>如果你正在嘗試 jOOQ
或者,如果您希望使用 jOOQ 開源版,則必須恢復到 3.14 版本,該版本仍然使用 Java 8 作為基準 - 或者,為什么不趁機升級到 Java 17...
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/446963.html
標籤:爪哇 行家 液基 乔克 jooq-codegen-maven
上一篇:MiloOPC-UA客戶端NoSuchMethod錯誤與io.netty.buffer.ByteBuf.writeMediumLE(int)
