Skip to content

Commit 0126d96

Browse files
committed
HHH-16801 document 'is true', 'is not true', 'is false', 'is not false' operators
1 parent 987a0df commit 0126d96

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

documentation/src/main/asciidoc/querylanguage/Expressions.adoc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,13 +1133,14 @@ from Book where price between 1.0 and 100.0
11331133
==== Operators for dealing with null
11341134

11351135
The following operators make it easier to deal with null values.
1136+
These predicates never evaluate to `null`.
11361137

11371138
[cols="20,20,15,~"]
11381139
|===
11391140
| Operator | Negation | Type | Semantics
11401141

1141-
| `is null` | `is not null` | Unary postfix | `true` if the value to the left is null
1142-
| `is distinct from` | `is not distinct from` | Binary | `true` if the value on the left is equal to the value on the right, or if both are null
1142+
| `is null` | `is not null` | Unary postfix | `true` if the value to the left is null, or false if it is not null
1143+
| `is distinct from` | `is not distinct from` | Binary | `true` if the value on the left is equal to the value on the right, or if both values are null, and false otherwise
11431144
|===
11441145

11451146
[[null-predicate-example]]
@@ -1148,6 +1149,33 @@ The following operators make it easier to deal with null values.
11481149
from Author where nomDePlume is not null
11491150
----
11501151

1152+
[[boolean-predicate]]
1153+
==== Operators for dealing with boolean values
1154+
1155+
These operators perform comparisons on values of type `boolean`.
1156+
These predicates never evaluate to `null`.
1157+
1158+
[NOTE]
1159+
====
1160+
The values `true` and `false` of the `boolean` basic type are different to the logical `true` or `false` produced by a predicate.
1161+
====
1162+
1163+
For _logical_ operations on <<conditional-expressions,predicates>>, see <<logical-operators>> below.
1164+
1165+
[cols="20,20,15,~"]
1166+
|===
1167+
| Operator | Negation | Type | Semantics
1168+
1169+
| `is true` | `is not true` | Unary postfix | `true` if the value to the left is `true`, or `false` otherwise
1170+
| `is false` | `is not false` | Binary | `true` if the value to the left is `false`, or `false` otherwise
1171+
|===
1172+
1173+
[[null-predicate-example]]
1174+
[source, hql]
1175+
----
1176+
from Book where discontinued is not true
1177+
----
1178+
11511179
[[collection-operators]]
11521180
==== Collection predicates
11531181

documentation/src/main/asciidoc/userguide/chapters/query/hql/QueryLanguage.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,27 @@ include::{example-dir-hql}/HQLTest.java[tags=hql-null-predicate-example]
12261226
----
12271227
====
12281228
1229+
[[boolean-predicate]]
1230+
==== Operators for dealing with boolean values
1231+
1232+
These operators perform comparisons on values of type `boolean`.
1233+
These predicates never evaluate to `null`.
1234+
1235+
[NOTE]
1236+
====
1237+
The values `true` and `false` of the `boolean` basic type are different to the logical `true` or `false` produced by a predicate.
1238+
====
1239+
1240+
For _logical_ operations on <<conditional-expressions,predicates>>, see <<logical-operators>> below.
1241+
1242+
[cols="20,20,15,~"]
1243+
|===
1244+
| Operator | Negation | Type | Semantics
1245+
1246+
| `is true` | `is not true` | Unary postfix | `true` if the value to the left is `true`, or `false` otherwise
1247+
| `is false` | `is not false` | Binary | `true` if the value to the left is `false`, or `false` otherwise
1248+
|===
1249+
12291250
[[hql-like-predicate]]
12301251
==== String pattern matching
12311252

0 commit comments

Comments
 (0)