I am trying to use aggregate function like max, min in jOOQ and refering their mannual but I am not understanding their examples that how they created max function and used it in their example. Can you please help me out on this. Please provide simple example if possible.
Problem I am facing
In jOOQ mannual example for aggregate function max is as follows
create.select(max(ID).add(1).as("next_id")).from(T_AUTHOR);
but when I used max in my query I am getting function max is undefined.
The use of static imports is documented in various places of the jOOQ tutorial and manual. Whenever you see a "standalone function" in the manual, you can safely assume that it was static imported from org.jooq.impl.DSL
.
See the example taken from the tutorial:
// For convenience, always static import your generated tables and
// jOOQ functions to decrease verbosity:
import static test.generated.Tables.*;
import static org.jooq.impl.DSL.*;
Hence, the example you're trying to run will require that you either
org.jooq.impl.DSL.max
DSL.max
in your queryIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With