#647 - REFACTOR: L2 cache - remove cache warming support (from @CacheStrategy and API)

This commit is contained in:
Robin Bygrave committed 2016-04-12 23:44:24 +12:00
1 parent 061652a48e
commit 3fb9a7414c
17 files changed
+35 -181

No files matched your search

@@ -895,13 +895,6 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
return owner.getEncryptKey(tableName, columnName);
}
/**
* Execute the warming cache query (if defined) and load the cache.
*/
public void runCacheWarming() {
cacheHelp.runCacheWarming(ebeanServer);
}
/**
* Return true if this bean type has a default select clause that is not
* simply select all properties.
@@ -1,7 +1,5 @@
package com.avaje.ebeaninternal.server.deploy;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.Query;
import com.avaje.ebean.bean.BeanCollection;
import com.avaje.ebean.bean.EntityBean;
import com.avaje.ebean.bean.EntityBeanIntercept;
@@ -88,26 +86,6 @@ final class BeanDescriptorCacheHelp<T> {
}
}
/**
* Execute the warming cache query (if defined) and load the cache.
*/
public void runCacheWarming(EbeanServer ebeanServer) {
if (cacheOptions == null) {
return;
}
String warmingQuery = cacheOptions.getWarmingQuery();
if (warmingQuery != null && warmingQuery.trim().length() > 0) {
Query<?> query = ebeanServer.createQuery(beanType, warmingQuery);
query.setUseCache(true);
query.setReadOnly(true);
query.setLoadBeanCache(true);
List<?> list = query.findList();
if (beanLog.isInfoEnabled()) {
beanLog.info("Loaded {} cache with [{}] beans", cacheName, list.size());
}
}
}
public void setUseCache(boolean useCache) {
if (useCache) {
getBeanCache();
@@ -218,7 +218,6 @@ public class AnnotationClass extends AnnotationParser {
if (cacheStrategy != null) {
cacheOptions.setUseCache(cacheStrategy.useBeanCache());
cacheOptions.setReadOnly(cacheStrategy.readOnly());
cacheOptions.setWarmingQuery(cacheStrategy.warmingQuery());
if (cacheStrategy.naturalKey().length() > 0) {
String propName = cacheStrategy.naturalKey().trim();
DeployBeanProperty beanProperty = descriptor.getBeanProperty(propName);