add a very important admonition to docs

This commit is contained in:
Gavin 2023-05-15 13:14:14 +02:00 committed by Christian Beikov
parent 42fcf306b9
commit 2998e97d41
1 changed files with 6 additions and 0 deletions

View File

@ -227,6 +227,12 @@ The cache defined by a `@Cache` annotation is automatically utilized by Hibernat
- retrieve an entity by id when `find()` is called, or - retrieve an entity by id when `find()` is called, or
- to resolve an association by id. - to resolve an association by id.
[WARNING]
====
The `@Cache` annotation must be specified on the _root class_ of an entity inheritance hierarchy.
It is an error to place it on a subclass entity.
====
The `@Cache` annotation always specifies a `CacheConcurrencyStrategy`, a policy governing access to the second-level cache by concurrent transactions. The `@Cache` annotation always specifies a `CacheConcurrencyStrategy`, a policy governing access to the second-level cache by concurrent transactions.
.Cache concurrency .Cache concurrency