mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-26 07:20:56 +00:00
#1679 - ENH: Support enabling/disabling L2 cache by "region" at runtime
This commit is contained in:
1 parent
ae228d6b0e
commit
86436ac3ac
10 files changed
+111
-87
No files matched your search
@@ -473,8 +473,8 @@ public class DeployBeanDescriptor<T> {
|
||||
/**
|
||||
* Set that this type invalidates query caches.
|
||||
*/
|
||||
public void setInvalidateQueryCache() {
|
||||
this.cacheOptions = CacheOptions.INVALIDATE_QUERY_CACHE;
|
||||
public void setInvalidateQueryCache(String region) {
|
||||
this.cacheOptions = CacheOptions.invalidateQueryCache(region);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -202,13 +202,12 @@ public class AnnotationClass extends AnnotationParser {
|
||||
} else {
|
||||
InvalidateQueryCache invalidateQueryCache = AnnotationUtil.findAnnotationRecursive(cls, InvalidateQueryCache.class);
|
||||
if (invalidateQueryCache != null) {
|
||||
descriptor.setInvalidateQueryCache();
|
||||
descriptor.setInvalidateQueryCache(invalidateQueryCache.region());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Set<NamedQuery> namedQueries = AnnotationUtil.findAnnotationsRecursive(cls, NamedQuery.class);
|
||||
for (NamedQuery namedQuery : namedQueries) {
|
||||
for (NamedQuery namedQuery : AnnotationUtil.findAnnotationsRecursive(cls, NamedQuery.class)) {
|
||||
descriptor.addNamedQuery(namedQuery.name(), namedQuery.query());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user