简体   繁体   中英

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. Same result is noticeable when upgrading to 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.

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: An exception has occurred in the compiler (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. Include your program and the following diagnostic in your report. Thank you. java: java.lang.AssertionError4

JAVA 11: functional interface not applicable

You seem to be using raw types with the jOOQ API (ie Select rather than Select<?> , or some explicit type bound). This is rarely a good idea both with jOOQ or with Java in general. In the case of jOOQ, the API explicitly excludes maintaining raw type backwards compatibility, which would be exceptionally hard to achieve, see eg:

You should be able to fix this issue by avoiding raw types.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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