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

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>
    <database>
      <whereMethodOverrides>false</whereMethodOverrides>
    </database>
  </generator>
</configuration>

See the configuration XSD, standalone code generation, and maven code generation for more details.

new org.jooq.meta.jaxb.Configuration()
  .withGenerator(new Generator()
    .withDatabase(new Database()
      .withWhereMethodOverrides(false)
    )
  )

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

import org.jooq.meta.jaxb.*


configuration {
  generator {
    database {
      isWhereMethodOverrides = false
    }
  }
}

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

configuration {
  generator {
    database {
      whereMethodOverrides = false
    }
  }
}

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

generationTool {
  generator {
    database {
      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