Class QueryCacheManager
java.lang.Object
io.jmix.eclipselink.impl.entitycache.QueryCacheManager
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.slf4j.Logger
static final int
Oracle's "IN" clause parameter max count: 1000protected Metadata
protected MetadataTools
protected EclipselinkProperties
protected QueryCache
protected StoreAwareLocator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDescendants
(Set<String> relatedTypes) <T> List<T>
getResultListFromCache
(QueryKey queryKey, List<FetchPlan> fetchPlans) Get query results from query cache by specifiedqueryKey
<T> T
getSingleResultFromCache
(QueryKey queryKey, List<FetchPlan> fetchPlans) Get single query results from query cache by specifiedqueryKey
If query is cached and no results found exception is thrownvoid
invalidate
(Class typeClass) Discards cached query results for java class (associated with metaClass)typeClass
void
invalidate
(String typeName) Discards cached query results for metaClass nametypeName
void
invalidate
(Set<String> typeNames) Discards cached query results for metaClass namestypeNames
void
boolean
Returns true if query cache enabledprotected <T> List<T>
loadAllByIds
(List<Object> queryCacheResult, MetaClass metaClass, List<FetchPlan> fetchPlans, JmixEntityManager em) loadBatchByIds
(List<?> queryCacheResult, MetaClass metaClass, String pkName, List<FetchPlan> fetchPlans, JmixEntityManager em) void
Put query results into query cache for specified queryqueryKey
.<T> void
putResultToCache
(QueryKey queryKey, T result, String type, Set<String> relatedTypes, RuntimeException exception) Put query results into query cache for specified queryqueryKey
.
-
Field Details
-
MAX_BATCH_SIZE
public static final int MAX_BATCH_SIZEOracle's "IN" clause parameter max count: 1000It is also usually exceeds cache size
- See Also:
-
properties
-
queryCache
-
metadata
-
metadataTools
-
storeAwareLocator
-
log
protected static final org.slf4j.Logger log
-
-
Constructor Details
-
QueryCacheManager
public QueryCacheManager()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns true if query cache enabled -
getResultListFromCache
Get query results from query cache by specifiedqueryKey
-
loadAllByIds
-
loadBatchByIds
-
getSingleResultFromCache
Get single query results from query cache by specifiedqueryKey
If query is cached and no results found exception is thrown -
putResultToCache
public void putResultToCache(QueryKey queryKey, List resultList, String type, Set<String> relatedTypes) Put query results into query cache for specified queryqueryKey
. Results are extracted as identifiers fromresultList
- Parameters:
type
- - result entity type (metaClass name)relatedTypes
- - query dependent types (metaClass names). It's a list of entity types used in query
-
putResultToCache
public <T> void putResultToCache(QueryKey queryKey, T result, String type, Set<String> relatedTypes, RuntimeException exception) Put query results into query cache for specified queryqueryKey
. Results are extracted as identifiers from entityresult
- Parameters:
type
- - result entity type (metaClass name)relatedTypes
- - query dependent types (metaClass names). It's a list of entity types used in queryexception
- - store exception in the query cache ifTypedQuery.getSingleResult()
throws exception
-
invalidate
Discards cached query results for java class (associated with metaClass)typeClass
-
invalidate
Discards cached query results for metaClass nametypeName
-
invalidate
Discards cached query results for metaClass namestypeNames
-
invalidateAll
public void invalidateAll() -
getDescendants
-