HHH-18892 document hash function support

This commit is contained in:
Gavin King 2024-12-03 20:52:57 +01:00
parent 5a8db1caa3
commit c73a12ced6
1 changed files with 19 additions and 2 deletions

View File

@ -1174,8 +1174,8 @@ Finally, the following functions evaluate the id, version, or natural id of an e
|===
| Function | Purpose | JPA standard
| `id()` | The value of the entity `@Id` attribute. |
| `version()` | The value of the entity `@Version` attribute. |
| `id()` | The value of the entity `@Id` attribute. |
| `version()` | The value of the entity `@Version` attribute. |
| `naturalid()` | The value of the entity `@NaturalId` attribute. | ✖
| `fk()` | The value of the foreign key column mapped by a `@ManyToOne` (or logical `@OneToOne`) association.
Useful with associations annotated `@NotFound`. | ✖
@ -1207,6 +1207,23 @@ However, we note that the following language constructs work with arrays, and ar
| `array includes subarray` | Determine if the elements of one array include all the elements of a second array
|===
[[functions-hash]]
=== Hash functions
The following functions work on most supported platforms:
[[hash-functions]]
[cols="12,~,^15"]
|===
| Function | Purpose | JPA standard
| `sha()` | The SHA256 hash of a string. | ✖
| `md5()` | The MD5 hash of a string. | ✖
|===
These functions accept a string and return `byte[]`.
The return value is compatible with the byte array produced by Java's `MessageDigest`.
[[embedding-sql]]
==== Embedding SQL expressions