org.apache.openjpa.jdbc.kernel
public class FinderCacheImpl extends Object implements FinderCache<ClassMapping,SelectExecutor,Result>
Constructor and Description |
---|
FinderCacheImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addExclusionPattern(String pattern)
Adds a pattern for exclusion.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
cache(ClassMapping mapping,
SelectExecutor select,
FetchConfiguration fetch)
Cache a Finder Query for the given mapping and select.
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
get(ClassMapping mapping,
FetchConfiguration fetch)
Gets the finder query for the given mapping.
|
List<String> |
getExcludes()
Gets the excluded stringified keys.
|
Map<String,String> |
getMapView()
Get a map-oriented view of the cache.
|
QueryStatistics<ClassMapping> |
getStatistics()
Gets basic statistics of execution and hit count of finder queries.
|
boolean |
invalidate(ClassMapping mapping)
Remove the FinderQuery for the given key from this cache.
|
boolean |
isExcluded(ClassMapping mapping)
Affirms if the given mapping is excluded from being cached.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
markUncachable(ClassMapping mapping)
Marks the given key as not amenable to caching.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
markUncachable(String id) |
void |
removeExclusionPattern(String pattern)
Removes a pattern for exclusion.
|
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
void |
setExcludes(String excludes) |
void |
startConfiguration()
Invoked before bean property configuration is begun on this object.
|
public Map<String,String> getMapView()
getMapView
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public QueryStatistics<ClassMapping> getStatistics()
getStatistics
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public FinderQuery<ClassMapping,SelectExecutor,Result> get(ClassMapping mapping, FetchConfiguration fetch)
HINT_IGNORE_FINDER
will ignore
any cached finder that may exist in this cache and will return null.
HINT_INVALIDATE_FINDER
will
invalidate any cached finder that may exist in this cache and will return
null.get
in interface FinderCache<ClassMapping,SelectExecutor,Result>
mapping
- for which the finder is looked uppublic FinderQuery<ClassMapping,SelectExecutor,Result> cache(ClassMapping mapping, SelectExecutor select, FetchConfiguration fetch)
cache
in interface FinderCache<ClassMapping,SelectExecutor,Result>
mapping
- the class for which the finder is to be cachedselect
- the finder queryfetch
- may contain hints to control cache operationIf a entry for the given mapping exists then the value of
{@link QueryHints#HINT_RECACHE_FINDER HINT_RECACHE_FINDER} hint
determines whether the existing entry is returned or a new FinderQuery
with the given argument overwrites the existing one.
public boolean isExcluded(ClassMapping mapping)
isExcluded
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public void addExclusionPattern(String pattern)
addExclusionPattern
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public void removeExclusionPattern(String pattern)
removeExclusionPattern
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public boolean invalidate(ClassMapping mapping)
FinderCache
invalidate
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public FinderQuery<ClassMapping,SelectExecutor,Result> markUncachable(ClassMapping mapping)
FinderCache
markUncachable
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public FinderQuery<ClassMapping,SelectExecutor,Result> markUncachable(String id)
public void setExcludes(String excludes)
public List<String> getExcludes()
FinderCache
getExcludes
in interface FinderCache<ClassMapping,SelectExecutor,Result>
public void startConfiguration()
Configurable
startConfiguration
in interface Configurable
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.