diff --git a/jOOQ/src/main/java/org/jooq/Field.java b/jOOQ/src/main/java/org/jooq/Field.java index 7b5ef95ac8..43a095a197 100644 --- a/jOOQ/src/main/java/org/jooq/Field.java +++ b/jOOQ/src/main/java/org/jooq/Field.java @@ -151,97 +151,6 @@ extends // API // ------------------------------------------------------------------------ - /** - * Apply an ad-hoc data type {@link Binding} to this field expression. - *
- * Rather than attaching data type bindings at code generation time, or
- * creating cumbersome expressions using
- * {@link DataType#asConvertedDataType(Binding)}, this method allows for
- * creating a derived field expression with an ad-hoc data type binding for
- * single query usage.
- *
- * @param The user type.
- * @param binding The binding to be applied on any operations using this
- * field.
- * @return A derived field expression using a new binding.
- */
- @NotNull
- Field convert(Binding
- * Rather than attaching data type converters at code generation time, or
- * creating cumbersome expressions using
- * {@link DataType#asConvertedDataType(Converter)}, this method allows for
- * creating a derived field expression with an ad-hoc data type converter for
- * single query usage.
- *
- * @param The user type.
- * @param converter The converter to be applied on any operations using this
- * field.
- * @return A derived field expression using a new converter.
- */
- @NotNull
- Field convert(Converter
- * Rather than attaching data type converters at code generation time, or
- * creating cumbersome expressions using
- * {@link DataType#asConvertedDataType(Class, Function, Function)}, this
- * method allows for creating a derived field expression with an ad-hoc data
- * type converter for single query usage.
- *
- * @param The user type.
- * @param converter The converter to be applied on any operations using this
- * field.
- * @return A derived field expression using a new converter.
- */
- @NotNull
- Field convert(
- Class toType,
- Function super T, ? extends U> from,
- Function super U, ? extends T> to
- );
-
- /**
- * Apply an ad-hoc read-only data type {@link Converter} to this field
- * expression.
- *
- * Rather than attaching data type converters at code generation time, or
- * creating cumbersome expressions using
- * {@link DataType#asConvertedDataTypeFrom(Class, Function)}, this method
- * allows for creating a derived field expression with an ad-hoc data type
- * converter for single query usage.
- *
- * @param The user type.
- * @param converter The read-only converter to be applied on any operations
- * using this field.
- * @return A derived field expression using a new converter.
- */
- @NotNull
- Field convertFrom(Class toType, Function super T, ? extends U> from);
-
- /**
- * Apply an ad-hoc write-only data type {@link Converter} to this field
- * expression.
- *
- * Rather than attaching data type converters at code generation time, or
- * creating cumbersome expressions using
- * {@link DataType#asConvertedDataTypeTo(Class, Function)}, this method
- * allows for creating a derived field expression with an ad-hoc data type
- * converter for single query usage.
- *
- * @param The user type.
- * @param converter The write-only converter to be applied on any operations
- * using this field.
- * @return A derived field expression using a new converter.
- */
- @NotNull
- Field convertTo(Class toType, Function super U, ? extends T> to);
-
/**
* The name of the field.
*
diff --git a/jOOQ/src/main/java/org/jooq/SelectField.java b/jOOQ/src/main/java/org/jooq/SelectField.java
index 2555fc736a..2f1f4d47b7 100644
--- a/jOOQ/src/main/java/org/jooq/SelectField.java
+++ b/jOOQ/src/main/java/org/jooq/SelectField.java
@@ -37,6 +37,8 @@
*/
package org.jooq;
+import java.util.function.Function;
+
import org.jooq.conf.Settings;
import org.jooq.impl.DSL;
@@ -94,4 +96,95 @@ public interface SelectField
+ * Rather than attaching data type bindings at code generation time, or
+ * creating cumbersome expressions using
+ * {@link DataType#asConvertedDataType(Binding)}, this method allows for
+ * creating a derived field expression with an ad-hoc data type binding for
+ * single query usage.
+ *
+ * @param The user type.
+ * @param binding The binding to be applied on any operations using this
+ * field.
+ * @return A derived field expression using a new binding.
+ */
+ @NotNull
+ Field convert(Binding
+ * Rather than attaching data type converters at code generation time, or
+ * creating cumbersome expressions using
+ * {@link DataType#asConvertedDataType(Converter)}, this method allows for
+ * creating a derived field expression with an ad-hoc data type converter for
+ * single query usage.
+ *
+ * @param The user type.
+ * @param converter The converter to be applied on any operations using this
+ * field.
+ * @return A derived field expression using a new converter.
+ */
+ @NotNull
+ Field convert(Converter
+ * Rather than attaching data type converters at code generation time, or
+ * creating cumbersome expressions using
+ * {@link DataType#asConvertedDataType(Class, Function, Function)}, this
+ * method allows for creating a derived field expression with an ad-hoc data
+ * type converter for single query usage.
+ *
+ * @param The user type.
+ * @param converter The converter to be applied on any operations using this
+ * field.
+ * @return A derived field expression using a new converter.
+ */
+ @NotNull
+ Field convert(
+ Class toType,
+ Function super T, ? extends U> from,
+ Function super U, ? extends T> to
+ );
+
+ /**
+ * Apply an ad-hoc read-only data type {@link Converter} to this field
+ * expression.
+ *
+ * Rather than attaching data type converters at code generation time, or
+ * creating cumbersome expressions using
+ * {@link DataType#asConvertedDataTypeFrom(Class, Function)}, this method
+ * allows for creating a derived field expression with an ad-hoc data type
+ * converter for single query usage.
+ *
+ * @param The user type.
+ * @param converter The read-only converter to be applied on any operations
+ * using this field.
+ * @return A derived field expression using a new converter.
+ */
+ @NotNull
+ Field convertFrom(Class toType, Function super T, ? extends U> from);
+
+ /**
+ * Apply an ad-hoc write-only data type {@link Converter} to this field
+ * expression.
+ *
+ * Rather than attaching data type converters at code generation time, or
+ * creating cumbersome expressions using
+ * {@link DataType#asConvertedDataTypeTo(Class, Function)}, this method
+ * allows for creating a derived field expression with an ad-hoc data type
+ * converter for single query usage.
+ *
+ * @param The user type.
+ * @param converter The write-only converter to be applied on any operations
+ * using this field.
+ * @return A derived field expression using a new converter.
+ */
+ @NotNull
+ Field convertTo(Class toType, Function super U, ? extends T> to);
+
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractRow.java b/jOOQ/src/main/java/org/jooq/impl/AbstractRow.java
index 6ad1f6f726..875a88378e 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AbstractRow.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AbstractRow.java
@@ -43,6 +43,7 @@ import static org.jooq.impl.Keywords.K_ROW;
import static org.jooq.impl.QueryPartListView.wrap;
import java.util.Collection;
+import java.util.function.Function;
import java.util.stream.Stream;
import org.jooq.Binding;
@@ -107,6 +108,31 @@ abstract class AbstractRow