PUBLIC:
A QueryResultsCache policy dictates how a query's results will be cached.
It allows an invalidation policy and a maximum number of results to be set.
Query results are cached based on the parameter values of a query, and the maximum number
of results refers to the maximum number of parameter sets results will be ached for.

See Also:

org.eclipse.persistence.queries.ReadQuery#setQueryCachePolicy(QueryResultsCachePolicy),
Serialized Form

QueryResultsCachePolicy

PUBLIC:
Build a QueryResultsCachePolicy and supply a maximum for the number of results sets.
Results will be set not to expire in the cache.

Method Detail

isNullIgnored

public boolean isNullIgnored()

PUBLIC:
Return if null results should be cached or ignored.
By default they are cached.
They can be ignored to allow a query cache to be used as a secondary cache index,
and allow new objects to be insert, and still found.

setIsNullIgnored

public void setIsNullIgnored(boolean isNullIgnored)

PUBLIC:
Set if null results should be cached or ignored.
By default they are cached.
They can be ignored to allow a query cache to be used as a secondary cache index,
and allow new objects to be insert, and still found.

getCacheType

public java.lang.Class getCacheType()

PUBLIC:
Return the type of the cache used for the query results.
This defaults to a LRU cache (CacheIdentityMap), but can be
set to any IdentityMap class, such as Full or Soft.

setCacheType

public void setCacheType(java.lang.Class cacheType)

PUBLIC:
Set the type of the cache used for the query results.
This defaults to a LRU cache (CacheIdentityMap), but can be
set to any IdentityMap class, such as Full or Soft.

useFullCache

public void useFullCache()

PUBLIC:
Set the type of the cache used for the query results to a FullIdentityMap.
This will cache all query results, so caution should be used to avoid running out of memory.

useSoftCache

public void useSoftCache()

PUBLIC:
Set the type of the cache used for the query results to a SoftIdentityMap.
This will cache all query results, unless the JVM believes memory is low.

useSoftLRUCache

public void useSoftLRUCache()

PUBLIC:
Set the type of the cache used for the query results to a SoftCacheWeakIdentityMap.
This will uses a fixed size LRU cache using Soft references, so will allow garbage collection when memory is low.

useLRUCache

public void useLRUCache()

PUBLIC:
Set the type of the cache used for the query results to a CacheIdentityMap.
This will uses a fixed size LRU cache.
This is the default.