Module org.jooq
Package org.jooq

Interface Generator<R extends Record,X extends Table<R>,T>

All Superinterfaces:
Function<GeneratorContext<R,X,T>,Field<T>>, Serializable
All Known Implementing Classes:
AuditGenerator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Generator<R extends Record,X extends Table<R>,T> extends Function<GeneratorContext<R,X,T>,Field<T>>, Serializable
A generator can be used with DataType.generatedAlwaysAs(Generator) to implement dynamic, client side computed columns, i.e. computed columns with QOM.GenerationLocation.CLIENT.

There are two types of client side computed columns:

Depending on the type of client side computed column, the exact time when the computation is performed may differ, practically. It is not specified, when it happens, but users may assume that it happens only once per query rendering and Field expression which references a Generator, independently of how many times the resulting expression is repeated in the resulting SQL query.

This API is part of a commercial only feature. To use this feature, please use the jOOQ Professional Edition or the jOOQ Enterprise Edition.

Author:
Lukas Eder
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether this generator supports a given statement type.

    Methods inherited from interface java.util.function.Function

    andThen, apply, compose
  • Method Details

    • supports

      default boolean supports(GeneratorStatementType statementType)
      Whether this generator supports a given statement type.

      Implementations may choose to deactivate themselves for some statement types, e.g. if they want to be invoked only for GeneratorStatementType.INSERT.

      Parameters:
      statementType - The statement type.