简体   繁体   English

jOOQ版本升级后无法编译maven Spring引导工程

[英]Cannot compile maven Spring Boot project after jOOQ version upgrade

After upgrading to the commercial 3.16.8 version of jOOQ (org.jooq.pro-java-8) my maven compile stage start to fail.升级到商业 3.16.8 版本的 jOOQ (org.jooq.pro-java-8) 后,我的 maven 编译阶段开始失败。 Same result is noticeable when upgrading to java-11.升级到 java-11 时,同样的结果也很明显。

What I found out is that the new version does not work with the following structure.我发现新版本不适用于以下结构。

Select sql = ....;
List<CustomTypeClass> result = sql.fetch(this::recordToCustomTypeClass);

where recordToCustomTypeClass is a function that takes Record and transform it to a CustomTypeClass.其中 recordToCustomTypeClass 是一个 function,它接受 Record 并将其转换为 CustomTypeClass。

Does anyone knows why this is no longer applicable?有谁知道为什么这不再适用?

The error with java 8 is general java error, with java 11 we have more direct message. java 8 的错误是一般的 java 错误,java 11 我们有更多的直接消息。

JAVA 8: JAVA 8:

java: An exception has occurred in the compiler (1.8.0_251). java:编译器(1.8.0_251)发生异常。 Please file a bug against the Java compiler via the Java bug reporting page ( http://bugreport.java.com ) after checking the Bug Database ( http://bugs.java.com ) for duplicates. Please file a bug against the Java compiler via the Java bug reporting page ( http://bugreport.java.com ) after checking the Bug Database ( http://bugs.java.com ) for duplicates. Include your program and the following diagnostic in your report.在报告中包含您的程序和以下诊断。 Thank you.谢谢你。 java: java.lang.AssertionError4 java:java.lang.AssertionError4

JAVA 11: functional interface not applicable JAVA 11:功能接口不适用

You seem to be using raw types with the jOOQ API (ie Select rather than Select<?> , or some explicit type bound).您似乎正在使用带有 jOOQ API 的原始类型(即Select而不是Select<?>或一些明确的类型绑定)。 This is rarely a good idea both with jOOQ or with Java in general.这对于 jOOQ 或 Java 通常都不是一个好主意。 In the case of jOOQ, the API explicitly excludes maintaining raw type backwards compatibility, which would be exceptionally hard to achieve, see eg:在 jOOQ 的情况下,API 明确排除维护原始类型向后兼容性,这将非常难以实现,请参见例如:

You should be able to fix this issue by avoiding raw types.您应该能够通过避免使用原始类型来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM