Package com.avaje.ebeaninternal.server.core

Examples of com.avaje.ebeaninternal.server.core.CacheOptions


    }
  }

  private void readCacheStrategy(CacheStrategy cacheStrategy, CacheTuning cacheTuning) {

    CacheOptions cacheOptions = descriptor.getCacheOptions();
    if (cacheTuning != null) {
      cacheOptions.setMaxSecsToLive(cacheTuning.maxSecsToLive());
      cacheOptions.setMaxIdleSecs(cacheTuning.maxIdleSecs());
    }
    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);
        if (beanProperty != null) {
          beanProperty.setNaturalKey(true);
          cacheOptions.setNaturalKey(propName);
        }
      }
    }
  }
View Full Code Here


    ResetBasicData.reset();

    SpiEbeanServer server = (SpiEbeanServer) Ebean.getServer(null);
    BeanDescriptor<Country> beanDescriptor = server.getBeanDescriptor(Country.class);
    CacheOptions cacheOptions = beanDescriptor.getCacheOptions();

    Assert.assertNotNull(cacheOptions);
    Assert.assertTrue(cacheOptions.isUseCache());
    Assert.assertTrue(cacheOptions.isReadOnly());
    Assert.assertTrue(beanDescriptor.isCacheSharableBeans());

    ServerCacheManager serverCacheManager = server.getServerCacheManager();
    serverCacheManager.clear(Country.class);
View Full Code Here

TOP

Related Classes of com.avaje.ebeaninternal.server.core.CacheOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.