Available in versions: Dev (3.20) | Latest (3.19)

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

Overriding where()

Applies to ✅ 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:

XML (standalone and maven)
Programmatic
Gradle (Kotlin)
Gradle (Groovy)
Gradle (third party)
<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.

generationTool {
  generator {
    generate {
      whereMethodOverrides = false
    }
  }
}

See the configuration XSD and gradle code generation for more details.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo