Enable cache for "AutoQueryData" and "FindAll

Basically, caching for the two default queries is done via the Persistence.xml is switched on. With the strategies "ENABLE_SELECTIVE" or "DISABLE_SELECTIVE" all caches are switched on or off. Caching can then be enabled or disabled for individual entities.

  1. Open the entity for which you want to change the cache strategy

  2. Switch to the code area by pressing "\{}Java".

  3. Insert an empty line after the last annotation +.
    Image not found

  4. Now use the code template "Enable QueryCache Single" or "Enable QueryCache Full" from the palette to insert the desired line of code

    Image not found

  5. Now you can edit the respective ENUMs for the added lines according to your needs.

*CashStoreMode Explanation

Name

Function

Default

USE

Should be used if this application is the only application accessing this data source. Since this strategy does not take into account a record modified by another JDBC data source and the cache is not updated.

YES

REFRESH

This strategy should be used if other applications also write to the same database and the cache needs to be refreshed on read

BYPASS

Reads the data from the cache. However, changes are not synchronized to the cache.