Overriding where()
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
inline derived tables can be a powerful feature for dynamic SQL, where client side views are created based on a table expression and a conditional expression.
// Overridden Book.where() returns Book, not Table<Book>:
Book b = BOOK.where(BOOK.TITLE.like("A%"));
// Type safe dereferencing of TableField:
Field<String> title = b.TITLE;
If generating these overrides is not a desireable default, it can be deactivated explicitly globally using the following flag:
<configuration>
<generator>
<generate>
<whereMethodOverrides>false</whereMethodOverrides>
</generate>
</generator>
</configuration>
See the configuration XSD, standalone code generation, and maven code generation for more details.
new org.jooq.meta.jaxb.Configuration()
.withGenerator(
new Generate()
.withWhereMethodOverrides(false)
)
See the configuration XSD and programmatic code generation for more details.
import org.jooq.meta.jaxb.*
configuration {
generator {
generate {
isWhereMethodOverrides = false
}
}
}
See the configuration XSD and gradle code generation for more details.
configuration {
generator {
generate {
whereMethodOverrides = false
}
}
}
See the configuration XSD and gradle code generation for more details.
// The jOOQ-codegen-gradle plugin has been introduced in version 3.19. // Please use the official plugin instead of the third party plugin that was recommended before.
Feedback
Do you have any feedback about this page? We'd love to hear it!