, ? extends QOM.BinaryConcat> $constructor() {
+ return (a1, a2) -> new BinaryConcat(a1, a2);
+ }
+
+ // -------------------------------------------------------------------------
+ // XXX: The Object API
+ // -------------------------------------------------------------------------
+
+ @Override
+ public boolean equals(Object that) {
+ if (that instanceof QOM.BinaryConcat o) {
+ return
+ StringUtils.equals($bytes1(), o.$bytes1()) &&
+ StringUtils.equals($bytes2(), o.$bytes2())
+ ;
+ }
+ else
+ return super.equals(that);
+ }
+}
diff --git a/jOOQ/src/main/java/org/jooq/impl/BinaryOverlay.java b/jOOQ/src/main/java/org/jooq/impl/BinaryOverlay.java
index 6bc895bb2a..3ef93864d9 100644
--- a/jOOQ/src/main/java/org/jooq/impl/BinaryOverlay.java
+++ b/jOOQ/src/main/java/org/jooq/impl/BinaryOverlay.java
@@ -127,7 +127,7 @@ implements
Overlay.accept0(ctx,
in, placing, startIndex, length,
- DSL::binaryLength, DSL::binarySubstring, DSL::binarySubstring
+ DSL::binaryLength, DSL::binaryConcat, DSL::binarySubstring, DSL::binarySubstring
);
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java
index 4d360c16a8..c606d11545 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DSL.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java
@@ -20922,6 +20922,62 @@ public class DSL {
return new BinaryBitLength(bytes);
}
+ /**
+ * The BINARY_CONCAT function.
+ *
+ * The concatenation of binary strings.
+ *
+ * @param bytes1 The first binary string.
+ * @param bytes2 The second binary string.
+ */
+ @NotNull
+ @Support({ POSTGRES, YUGABYTEDB })
+ public static Field binaryConcat(byte[] bytes1, byte[] bytes2) {
+ return new BinaryConcat(Tools.field(bytes1), Tools.field(bytes2));
+ }
+
+ /**
+ * The BINARY_CONCAT function.
+ *
+ * The concatenation of binary strings.
+ *
+ * @param bytes1 The first binary string.
+ * @param bytes2 The second binary string.
+ */
+ @NotNull
+ @Support({ POSTGRES, YUGABYTEDB })
+ public static Field binaryConcat(byte[] bytes1, Field bytes2) {
+ return new BinaryConcat(Tools.field(bytes1), bytes2);
+ }
+
+ /**
+ * The BINARY_CONCAT function.
+ *
+ * The concatenation of binary strings.
+ *
+ * @param bytes1 The first binary string.
+ * @param bytes2 The second binary string.
+ */
+ @NotNull
+ @Support({ POSTGRES, YUGABYTEDB })
+ public static Field binaryConcat(Field bytes1, byte[] bytes2) {
+ return new BinaryConcat(bytes1, Tools.field(bytes2));
+ }
+
+ /**
+ * The BINARY_CONCAT function.
+ *
+ * The concatenation of binary strings.
+ *
+ * @param bytes1 The first binary string.
+ * @param bytes2 The second binary string.
+ */
+ @NotNull
+ @Support({ POSTGRES, YUGABYTEDB })
+ public static Field binaryConcat(Field bytes1, Field bytes2) {
+ return new BinaryConcat(bytes1, bytes2);
+ }
+
/**
* The BINARY_LENGTH function.
*
diff --git a/jOOQ/src/main/java/org/jooq/impl/Names.java b/jOOQ/src/main/java/org/jooq/impl/Names.java
index 2eb60e96b4..3fea52acbe 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Names.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Names.java
@@ -331,6 +331,7 @@ final class Names {
static final Name N_ATN2 = systemName("atn2");
static final Name N_AVG = systemName("avg");
static final Name N_BINARY_BIT_LENGTH = systemName("binary_bit_length");
+ static final Name N_BINARY_CONCAT = systemName("binary_concat");
static final Name N_BINARY_LENGTH = systemName("binary_length");
static final Name N_BINARY_LTRIM = systemName("binary_ltrim");
static final Name N_BINARY_MD5 = systemName("binary_md5");
diff --git a/jOOQ/src/main/java/org/jooq/impl/Overlay.java b/jOOQ/src/main/java/org/jooq/impl/Overlay.java
index 81e47ecf62..42015515de 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Overlay.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Overlay.java
@@ -135,7 +135,7 @@ implements
accept0(ctx,
in, placing, startIndex, length,
- DSL::length, DSL::substring, DSL::substring
+ DSL::length, (f1, f2) -> DSL.concat(f1, f2), DSL::substring, DSL::substring
);
}
@@ -146,6 +146,7 @@ implements
Field extends Number> startIndex,
Field extends Number> length,
Function1 super Field, ? extends Field extends Number>> fLength,
+ Function2 super Field, ? super Field, ? extends Field> fConcat,
Function2 super Field, ? super Field extends Number>, ? extends Field> fSubstring2,
Function3 super Field, ? super Field extends Number>, ? super Field extends Number>, ? extends Field> fSubstring3
) {
@@ -171,9 +172,13 @@ implements
// [#16101] TODO: Use binaryConcat() if necessary
ctx.visit(
- fSubstring3.apply(in, inline(1), isub(startIndex, inline(1)))
- .concat(placing)
- .concat(fSubstring2.apply(in, iadd(startIndex, l)))
+ fConcat.apply(
+ fConcat.apply(
+ fSubstring3.apply(in, inline(1), isub(startIndex, inline(1))),
+ placing
+ ),
+ fSubstring2.apply(in, iadd(startIndex, l))
+ )
);
}
else {
@@ -194,11 +199,14 @@ implements
NO_SUPPORT.contains(ctx.dialect())
) {
- // [#16101] TODO: Use binaryConcat() if necessary
ctx.visit(
- fSubstring3.apply(in, inline(1), isub(startIndex, inline(1)))
- .concat(placing)
- .concat(fSubstring2.apply(in, iadd(startIndex, fLength.apply(placing))))
+ fConcat.apply(
+ fConcat.apply(
+ fSubstring3.apply(in, inline(1), isub(startIndex, inline(1))),
+ placing
+ ),
+ fSubstring2.apply(in, iadd(startIndex, fLength.apply(placing)))
+ )
);
}
else {
diff --git a/jOOQ/src/main/java/org/jooq/impl/QOM.java b/jOOQ/src/main/java/org/jooq/impl/QOM.java
index 99d0859ee4..58e89e54f6 100644
--- a/jOOQ/src/main/java/org/jooq/impl/QOM.java
+++ b/jOOQ/src/main/java/org/jooq/impl/QOM.java
@@ -5844,6 +5844,43 @@ public final class QOM {
@NotNull default BinaryBitLength $bytes(Field newBytes) { return $arg1(newBytes); }
}
+ /**
+ * The BINARY CONCAT function.
+ *
+ * The concatenation of binary strings.
+ */
+ public /*sealed*/ interface BinaryConcat
+ extends
+ UReturnsNullOnNullInput,
+ UOperator2, Field, BinaryConcat>,
+ org.jooq.Field
+ //permits
+ // BinaryConcat
+ {
+
+ /**
+ * The first binary string.
+ */
+ @NotNull default Field $bytes1() { return $arg1(); }
+
+ /**
+ * The first binary string.
+ */
+ @CheckReturnValue
+ @NotNull default BinaryConcat $bytes1(Field newBytes1) { return $arg1(newBytes1); }
+
+ /**
+ * The second binary string.
+ */
+ @NotNull default Field $bytes2() { return $arg2(); }
+
+ /**
+ * The second binary string.
+ */
+ @CheckReturnValue
+ @NotNull default BinaryConcat $bytes2(Field newBytes2) { return $arg2(newBytes2); }
+ }
+
/**
* The BINARY LENGTH function.
*