From 2c6cbeebb3778dae0e3ec6e180efe66c85f99e00 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 14 Sep 2018 14:08:30 +0200 Subject: [PATCH] [#7846] Document the fact that converters can be Java code --- .../resources/org/jooq/web/manual-3.10.xml | 66 +++++++++++++++++++ .../resources/org/jooq/web/manual-3.11.xml | 66 +++++++++++++++++++ .../resources/org/jooq/web/manual-3.12.xml | 66 +++++++++++++++++++ 3 files changed, 198 insertions(+) diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.10.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.10.xml index 29beb9ab84..5b6c7e8b7a 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.10.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.10.xml @@ -16311,6 +16311,72 @@ public class CaseInsensitiveOrderProvider implements Comparator { For more information about using converters, .

+

Mapping to user type with an inline converter

+ +

+ For convenience, you can inline your converter code directly into the configuration instead of providing a class reference. +

+ +

+ XML configuration (standalone and Maven) +

+ + + + + + + + + + com.example.MyEnum + + + org.jooq.Converter.ofNullable(Integer.class, MyEnum.class, i -> MyEnum.values()[i], MyEnum::ordinal) + + + .*\.DATE_OF_.* + .* + + + + +]]> + +

+ Programmatic configuration +

+ + MyEnum.values()[i], MyEnum::ordinal)") + .withExpression(".*\.DATE_OF_.*") + .withTypes(".*")))));]]> + +

+ Gradle configuration +

+ + MyEnum.values()[i], MyEnum::ordinal)' + expression = '.*\.DATE_OF_.*' + types = '.*' + } + } + } + } +}]]> +

Mapping to an enum user type with a converter

diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.11.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.11.xml index f2db8e0f9b..457b464aee 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.11.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.11.xml @@ -16951,6 +16951,72 @@ public class CaseInsensitiveOrderProvider implements Comparator { For more information about using converters, .

+

Mapping to user type with an inline converter

+ +

+ For convenience, you can inline your converter code directly into the configuration instead of providing a class reference. +

+ +

+ XML configuration (standalone and Maven) +

+ + + + + + + + + + com.example.MyEnum + + + org.jooq.Converter.ofNullable(Integer.class, MyEnum.class, i -> MyEnum.values()[i], MyEnum::ordinal) + + + .*\.DATE_OF_.* + .* + + + + +]]> + +

+ Programmatic configuration +

+ + MyEnum.values()[i], MyEnum::ordinal)") + .withExpression(".*\.DATE_OF_.*") + .withTypes(".*")))));]]> + +

+ Gradle configuration +

+ + MyEnum.values()[i], MyEnum::ordinal)' + expression = '.*\.DATE_OF_.*' + types = '.*' + } + } + } + } +}]]> +

Mapping to an enum user type with a converter

diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml index 15b6fc1788..78ba2eee58 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml @@ -16995,6 +16995,72 @@ public class CaseInsensitiveOrderProvider implements Comparator { For more information about using converters, .

+

Mapping to user type with an inline converter

+ +

+ For convenience, you can inline your converter code directly into the configuration instead of providing a class reference. +

+ +

+ XML configuration (standalone and Maven) +

+ + + + + + + + + + com.example.MyEnum + + + org.jooq.Converter.ofNullable(Integer.class, MyEnum.class, i -> MyEnum.values()[i], MyEnum::ordinal) + + + .*\.DATE_OF_.* + .* + + + + +]]> + +

+ Programmatic configuration +

+ + MyEnum.values()[i], MyEnum::ordinal)") + .withExpression(".*\.DATE_OF_.*") + .withTypes(".*")))));]]> + +

+ Gradle configuration +

+ + MyEnum.values()[i], MyEnum::ordinal)' + expression = '.*\.DATE_OF_.*' + types = '.*' + } + } + } + } +}]]> +

Mapping to an enum user type with a converter