3.11.1.1.2. Integration with JPA standard shared cache mode
JPA 2.0 specification introduced the standard data cache configuration through the shared-cache-mode element or jakarta.persistence. sharedCache.mode property.
When only the shared cache mode is configured to turn on the caching, the default data cache setting will be used. For example the cache size will be set to default 1000.
When the shared cache mode and openjpa.DataCache are both configured, the JPA standard shared cache mode configuration takes the precedence.
If the shared cache mode is to turn on the caching, the cache setting configured through openjpa.DataCache , like cacheSize and SoftReferenceSize, will be used to initialize or manage the cache. The Types and ExcludeTypes property in openjpa.DataCache will be ingnored since the shared cache mode in conjunction with the jakarta.persistence.Cacheable annotation already defines what will be cached.
When the shared cache mode is set to NONE, the data cache will be disabled no matter how openjpa.DataCache is configured.
When the shared cache mode is set to ALL, all entities will be cached no matter how openjpa.DataCache is configured.
When the shared cache mode set to ENABLE_SELECTIVE, the entities with Cacheable(true) anotation will be cached. ExcludedTypes will be ignored.