From da3ef5f7eb9866aedd6481f5c1a2ff03d9e45ce4 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Tue, 9 Oct 2018 16:37:23 +0200 Subject: [PATCH] [#1725] Document SIMILAR TO predicate support --- .../resources/org/jooq/web/manual-3.12.xml | 106 ++++++++++++------ 1 file changed, 74 insertions(+), 32 deletions(-) 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 9e64d05f2f..c7413f1f84 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 @@ -9147,19 +9147,19 @@ BOOK.PUBLISHED_IN.notBetweenSymmetric(1940).and(1920)]]> -
- LIKE predicate - -

- LIKE predicates are popular for simple wildcard-enabled pattern matching. Supported wildcards in all SQL databases are: -

-
    -
  • _: (single-character wildcard)
  • -
  • %: (multi-character wildcard)
  • -
-

- With jOOQ, the LIKE predicate can be created from any as such: -

+
+ LIKE predicate + +

+ LIKE predicates are popular for simple wildcard-enabled pattern matching. Supported wildcards in all SQL databases are: +

+
    +
  • _: (single-character wildcard)
  • +
  • %: (multi-character wildcard)
  • +
+

+ With jOOQ, the LIKE predicate can be created from any as such: +

BOOK.TITLE.notLike("%abc%")]]> -

Escaping operands with the LIKE predicate

-

- Often, your pattern may contain any of the wildcard characters "_" and "%", in case of which you may want to escape them. jOOQ does not automatically escape patterns in like() and notLike() methods. Instead, you can explicitly define an escape character as such: -

+

Escaping operands with the LIKE predicate

+

+ Often, your pattern may contain any of the wildcard characters "_" and "%", in case of which you may want to escape them. jOOQ does not automatically escape patterns in like() and notLike() methods. Instead, you can explicitly define an escape character as such: +

BOOK.TITLE.notLike("%The !%-Sign Book%", '!')]]> -

- In the above predicate expressions, the exclamation mark character is passed as the escape character to escape wildcard characters "!_" and "!%", as well as to escape the escape character itself: "!!" -

-

- Please refer to your database manual for more details about escaping patterns with the LIKE predicate. -

+

+ In the above predicate expressions, the exclamation mark character is passed as the escape character to escape wildcard characters "!_" and "!%", as well as to escape the escape character itself: "!!" +

+

+ Please refer to your database manual for more details about escaping patterns with the LIKE predicate. +

-

jOOQ's convenience methods using the LIKE predicate

-

- In addition to the above, jOOQ provides a few convenience methods for common operations performed on strings using the LIKE predicate. Typical operations are "contains predicates", "starts with predicates", "ends with predicates", etc. Here is the full convenience API wrapping LIKE predicates: -

+

jOOQ's convenience methods using the LIKE predicate

+

+ In addition to the above, jOOQ provides a few convenience methods for common operations performed on strings using the LIKE predicate. Typical operations are "contains predicates", "starts with predicates", "ends with predicates", etc. Here is the full convenience API wrapping LIKE predicates: +

-

- Note, that jOOQ escapes % and _ characters in value in some of the above predicate implementations. For simplicity, this has been omitted in this manual. -

-
-
+

+ Note, that jOOQ escapes % and _ characters in value in some of the above predicate implementations. For simplicity, this has been omitted in this manual. +

+
+
+ +
+ SIMILAR TO predicate + +

+ SIMILAR TO predicates are popular for more complex wildcard and regular expression enabled pattern matching. Supported wildcards in all SQL databases are: +

+
    +
  • _: (single-character wildcard)
  • +
  • %: (multi-character wildcard)
  • +
+

+ With jOOQ, the SIMILAR TO predicate can be created from any as such: +

+ + + + + + +

Escaping operands with the SIMILAR TO predicate

+

+ Often, your pattern may contain any of the wildcard characters "_" and "%", in case of which you may want to escape them. jOOQ does not automatically escape patterns in similarTo() and notSimilarTo() methods. Instead, you can explicitly define an escape character as such: +

+ + + + + + +

+ In the above predicate expressions, the exclamation mark character is passed as the escape character to escape wildcard characters "!_" and "!%", as well as to escape the escape character itself: "!!" +

+

+ Please refer to your database manual for more details about escaping patterns with the SIMILAR TO predicate as well as what regular expression syntax is supported. +

+
+
IN predicate