Enable cache for queries (JPASQL)

Custom queries created using the JPASQL API can be cached very easily using a "cachable" addition.

findAllCustomers()
{
    select * from Customer cacheable
}

Furthermore, the cache strategy can be set for exactly this query

findAllCustomers()
{
    select * from Customer cacheable storemode use retrievemode use
}

*Possible settings are

Function

Description

Default

storemode use

Writes / Reads data to / from the cache

YES

retrievemode use

Reads data from the cache but does not update it

YES

storemode bypass

Reads the data from the database and updates the cache

NO

retrievemode bypass

Reads the data from the cache. Writes back changes but not

NO

storemode refresh

Behavior see "use"

NO