@@ -1118,17 +1118,15 @@ The following functions deal with SQL array types, which are not supported on ev
11181118| Function | Purpose
11191119
11201120| `array()` | Creates an array based on the passed arguments
1121- | `array_contains()` | Whether an array contains an element
1122- | `array_contains_null()` | Whether an array contains a null
11231121| `array_position()` | Determines the position of an element in an array
11241122| `array_length()` | Determines the length of an array
11251123| `array_concat()` | Concatenates array with each other in order
11261124| `array_prepend()` | Prepends element to array
11271125| `array_append()` | Appends element to array
1128- | `array_contains_all ()` | Determines if one array holds all elements of another array
1129- | `array_contains_all_nullable ()` | Determines if one array holds all elements of another array , supporting null elements
1130- | `array_contains_any ()` | Determines if one array holds at least one element of another array
1131- | `array_contains_any_nullable ()` | Determines if one array holds at least one element of another array, supporting null elements
1126+ | `array_contains ()` | Whether an array contains element(s)
1127+ | `array_contains_nullable ()` | Whether an array contains element(s) , supporting ` null` elements
1128+ | `array_overlaps ()` | Whether an array holds at least one element of another array
1129+ | `array_overlaps_nullable ()` | Whether an array holds at least one element of another array, supporting ` null` elements
11321130| `array_get()` | Accesses the element of an array by index
11331131| `array_set()` | Creates array copy with given element at given index
11341132| `array_remove()` | Creates array copy with given element removed
@@ -1148,25 +1146,6 @@ include::{array-example-dir-hql}/ArrayConstructorTest.java[tags=hql-array-exampl
11481146----
11491147====
11501148
1151- [[hql-array-contains-functions]]
1152- ===== `array_contains()` and `array_contains_null()`
1153-
1154- Both functions return `null` if the first argument, the array, is null, yet the result of the `array_contains` function
1155- is undefined when the second argument, the element to search, is `null`.
1156- The `array_contains_null` function only takes a single argument, the array, and will return whether the array contains a `null` element.
1157-
1158- [[hql-array-contains-example]]
1159- ====
1160- [source, JAVA, indent=0]
1161- ----
1162- include::{array-example-dir-hql}/ArrayContainsTest.java[tags=hql-array-contains-example]
1163- ----
1164- [source, JAVA, indent=0]
1165- ----
1166- include::{array-example-dir-hql}/ArrayContainsTest.java[tags=hql-array-contains-null-example]
1167- ----
1168- ====
1169-
11701149[[hql-array-position-functions]]
11711150===== `array_position()`
11721151
@@ -1232,49 +1211,63 @@ include::{array-example-dir-hql}/ArrayAppendTest.java[tags=hql-array-append-exam
12321211----
12331212====
12341213
1235- [[hql-array-contains-quantified-functions]]
1236- ===== `array_contains_all()` and `array_contains_any()`
1214+ [[hql-array-contains-functions]]
1215+ ===== `array_contains()` and `array_contains_nullable()`
1216+
1217+ Checks if the first array argument contains the element(s) of the second argument.
1218+ Returns `null` if the first argument is `null`. The result of the `array_contains` function
1219+ is undefined when the second argument, the element to search, is `null`.
1220+
1221+ [[hql-array-contains-example]]
1222+ ====
1223+ [source, JAVA, indent=0]
1224+ ----
1225+ include::{array-example-dir-hql}/ArrayContainsTest.java[tags=hql-array-contains-example]
1226+ ----
1227+ ====
12371228
1238- Checks if the first array argument contains all or any of the elements of the second array argument.
1239- Returns `null` if either of the arguments is `null`. The result of the functions
1240- is undefined when the second array argument contains a `null`.
1229+ The second argument may be an array of the same type as the first argument.
1230+ The result of `array_contains` is undefined when the second argument is an array that contains a `null` element.
12411231
1242- [[hql-array-contains-all -example]]
1232+ [[hql-array-contains-array -example]]
12431233====
12441234[source, JAVA, indent=0]
12451235----
12461236include::{array-example-dir-hql}/ArrayContainsAllTest.java[tags=hql-array-contains-all-example]
12471237----
12481238====
12491239
1250- [[hql-array-contains-any-example]]
1240+ To search for `null` elements, the `array_contains_nullable` function must be used with an array argument.
1241+
1242+ [[hql-array-contains-array-nullable-example]]
12511243====
12521244[source, JAVA, indent=0]
12531245----
1254- include::{array-example-dir-hql}/ArrayContainsAnyTest .java[tags=hql-array-contains-any -example]
1246+ include::{array-example-dir-hql}/ArrayContainsAllTest .java[tags=hql-array-contains-all-nullable -example]
12551247----
12561248====
12571249
1258- [[hql-array-contains-quantified -functions]]
1259- ===== `array_contains_all_nullable ()` & `array_contains_any_nullable ()`
1250+ [[hql-array-overlaps -functions]]
1251+ ===== `array_overlaps ()` and `array_overlaps_nullable ()`
12601252
1261- Checks if the first array argument contains all or any of the elements of the second array argument.
1262- Returns `null` if either of the arguments is `null`. Contrary to `array_contains_all()` and `array_contains_any()`,
1263- these functions use the `distinct from` operator to also support searching for `null` elements.
1253+ Checks if the first array argument any of the elements of the second array argument.
1254+ Returns `null` if either of the arguments is `null`. The result of `array_overlaps`
1255+ is undefined when the second array argument contains a `null` array element.
1256+ Only `array_overlaps_nullable` is guaranteed to produce correct results for `null` array elements.
12641257
1265- [[hql-array-contains-all-nullable -example]]
1258+ [[hql-array-overlaps -example]]
12661259====
12671260[source, JAVA, indent=0]
12681261----
1269- include::{array-example-dir-hql}/ArrayContainsAllTest .java[tags=hql-array-contains-all-nullable -example]
1262+ include::{array-example-dir-hql}/ArrayOverlapsTest .java[tags=hql-array-overlaps -example]
12701263----
12711264====
12721265
1273- [[hql-array-contains-any -nullable-example]]
1266+ [[hql-array-overlaps -nullable-example]]
12741267====
12751268[source, JAVA, indent=0]
12761269----
1277- include::{array-example-dir-hql}/ArrayContainsAnyTest .java[tags=hql-array-contains-any -nullable-example]
1270+ include::{array-example-dir-hql}/ArrayOverlapsTest .java[tags=hql-array-overlaps -nullable-example]
12781271----
12791272====
12801273
0 commit comments