Module org.jooq
Package org.jooq

Class Replacers

java.lang.Object
org.jooq.Replacers

@Experimental @Pro public final class Replacers extends Object
A set of Replacer constructor methods.

This API is EXPERIMENTAL. Use at your own risk.

Author:
Lukas Eder
  • Method Details

    • decomposing

      @NotNull public static final @NotNull Replacer decomposing()
      Decomposes compound queries into their component queries.

      Some DDL statements are compound statements, such as e.g.

      
       ALTER TABLE t
         ADD col1 INT,
         ADD col2 INT;
       

      The above single compound statement can be decomposed into its component statements:

      
       ALTER TABLE t ADD col1 INT;
       ALTER TABLE t ADD col2 INT;
       

      Some use-cases, including DDL interpretation may be better served by component statements rather than the compound version.

      As this Replacer has to adhere to the contract imposed by Replacer.replacer(), it can only operate on Queries and other Query wrapping elements, such as Block and other procedural scope statements.

    • listening

      @NotNull public static final @NotNull Replacer listening(Replacer replacer, BiConsumer<? super QueryPart,? super QueryPart> replacement)
      Wraps another Replacer, listening to all of the replacement events that it produces.
      Parameters:
      replacer - The wrapped replacer
      replacement - A consumer that receives before and after QueryPart instances, in case the wrapped replacer has replaced a QueryPart.
      Returns:
      The wrapping Replacer