Module org.jooq
Package org.jooq

Interface TransformProvider

All Known Implementing Classes:
DefaultTransformProvider

@Pro public interface TransformProvider
An SPI to provide SQL transformation configuration and behaviour.

For convenience, consider extending DefaultTransformProvider instead of implementing this interface. This will prevent compilation errors in future versions of jOOQ, when this interface might get new methods.

Author:
Lukas Eder
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    [#5970] Inline all bind variables that are compared with the argument field.
  • Method Details

    • inlineBindValuesForFieldComparisons

      default boolean inlineBindValuesForFieldComparisons(Field<?> field)
      [#5970] Inline all bind variables that are compared with the argument field.

      In some cases, using a bind variable isn't the right choice when comparing a value with a Field. This could be the case e.g. when:

      • The field stems from a constant discriminator column in a view, e.g. in a UNION
      • The field statistics suggest there are only few possible values, with unequal distribution
      • The field is an ENUM or has a CHECK constraint (special case of the above)

      In all of those cases, it may be more optimal to query FIELD = 'x' rather than FIELD = ? to help the optimiser use more accurate statistics for the specific inline value, rather than an average distribution assumption for a generic bind value.

      Affected QueryPart types

      The following Condition types are affected by this transformation:

      Settings

      The feature can be activated using Settings.isTransformInlineBindValuesForFieldComparisons().

      Parameters:
      field - The field for which bind values could be inlined.
      Returns:
      Whether bind value should be inlined.