mirror of https://github.com/apache/openjpa.git
reduce performance cost of isCacheable().
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@897308 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3065f2febb
commit
5cef9cff17
|
@ -160,19 +160,16 @@ public class DataCacheManagerImpl
|
||||||
* @return TRUE or FALSE if cache mode is configured. null otherwise.
|
* @return TRUE or FALSE if cache mode is configured. null otherwise.
|
||||||
*/
|
*/
|
||||||
private Boolean isCacheableByMode(ClassMetaData meta) {
|
private Boolean isCacheableByMode(ClassMetaData meta) {
|
||||||
switch (DataCacheMode.valueOf(_conf.getDataCacheMode())) {
|
String mode = _conf.getDataCacheMode();
|
||||||
case ALL: // include everything, regardless of annotation or xml configuration
|
if (DataCacheMode.ALL.toString().equalsIgnoreCase(mode))
|
||||||
return true;
|
return true;
|
||||||
case NONE: // exclude everything, regardless of annotation of xml configuration
|
if (DataCacheMode.NONE.toString().equalsIgnoreCase(mode))
|
||||||
return false;
|
return false;
|
||||||
case ENABLE_SELECTIVE: // cache only those entities which were explicitly enabled
|
if (DataCacheMode.ENABLE_SELECTIVE.toString().equalsIgnoreCase(mode))
|
||||||
return Boolean.TRUE.equals(meta.getCacheEnabled());
|
return Boolean.TRUE.equals(meta.getCacheEnabled());
|
||||||
case DISABLE_SELECTIVE: // exclude *only* the entities which are explicitly excluded
|
if (DataCacheMode.DISABLE_SELECTIVE.toString().equalsIgnoreCase(mode))
|
||||||
return !Boolean.FALSE.equals(meta.getCacheEnabled());
|
return !Boolean.FALSE.equals(meta.getCacheEnabled());
|
||||||
case UNSPECIFIED:
|
return null;
|
||||||
default: // not determinable by mode
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue