HHH-11066 - Documentation regarding the reason @Filter is not supported with @Cache for collections
This commit is contained in:
parent
fc1a49b13b
commit
95ac619bce
|
@ -1445,6 +1445,17 @@ include::{extrasdir}/basic/mapping-filter-collection-query-example.sql[]
|
|||
The main advantage of `@Filter` over teh `@Where` clause is that the filtering criteria can be customized at runtime.
|
||||
====
|
||||
|
||||
[WARNING]
|
||||
====
|
||||
It's not possible to combine the `@Filter` and `@Cache` collection annotations.
|
||||
This limitation is due to ensuring consistency and because the filtering information is not stored in the second-level cache.
|
||||
|
||||
If caching was allowed for a currently filtered collection, then the second-level cache would store only a subset of the whole collection.
|
||||
Afterward, every other Session will get the filtered collection from the cache, even if the Session-level filters have not been explicitly activated.
|
||||
|
||||
For this reason, the second-level collection cache is limited to storing whole collections, and not subsets.
|
||||
====
|
||||
|
||||
[[mapping-column-any]]
|
||||
==== @Any mapping
|
||||
|
||||
|
|
Loading…
Reference in New Issue