Skip to content

Commit c73a12c

Browse files
committed
HHH-18892 document hash function support
1 parent 5a8db1c commit c73a12c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,8 +1174,8 @@ Finally, the following functions evaluate the id, version, or natural id of an e
11741174
|===
11751175
| Function | Purpose | JPA standard
11761176

1177-
| `id()` | The value of the entity `@Id` attribute. |
1178-
| `version()` | The value of the entity `@Version` attribute. |
1177+
| `id()` | The value of the entity `@Id` attribute. |
1178+
| `version()` | The value of the entity `@Version` attribute. |
11791179
| `naturalid()` | The value of the entity `@NaturalId` attribute. | ✖
11801180
| `fk()` | The value of the foreign key column mapped by a `@ManyToOne` (or logical `@OneToOne`) association.
11811181
Useful with associations annotated `@NotFound`. | ✖
@@ -1207,6 +1207,23 @@ However, we note that the following language constructs work with arrays, and ar
12071207
| `array includes subarray` | Determine if the elements of one array include all the elements of a second array
12081208
|===
12091209

1210+
[[functions-hash]]
1211+
=== Hash functions
1212+
1213+
The following functions work on most supported platforms:
1214+
1215+
[[hash-functions]]
1216+
[cols="12,~,^15"]
1217+
|===
1218+
| Function | Purpose | JPA standard
1219+
1220+
| `sha()` | The SHA256 hash of a string. | ✖
1221+
| `md5()` | The MD5 hash of a string. | ✖
1222+
|===
1223+
1224+
These functions accept a string and return `byte[]`.
1225+
The return value is compatible with the byte array produced by Java's `MessageDigest`.
1226+
12101227
[[embedding-sql]]
12111228
==== Embedding SQL expressions
12121229

0 commit comments

Comments
 (0)