Package com.avaje.ebean.cache

Examples of com.avaje.ebean.cache.ServerCache.clear()


  public void manyPropClear(String propertyName) {
    ServerCache collectionIdsCache = cacheManager.getCollectionIdsCache(beanType, propertyName);
    if (manyLog.isDebugEnabled()) {
      manyLog.debug("   CLEAR {}(*).{} ", cacheName, propertyName);
    }
    collectionIdsCache.clear();
  }

  /**
   * Return the CachedManyIds for a given bean many property. Returns null if not in the cache.
   */
 
View Full Code Here


    // cacheManager.setCaching(Customer.class, true);
    // cacheManager.setCaching(Contact.class, true);

    custCache.clear();
    custManyIdsCache.clear();

    List<Customer> list = Ebean.find(Customer.class).setAutofetch(false).setLoadBeanCache(true)
        .order().asc("id").findList();

    Assert.assertTrue(list.size() > 1);
View Full Code Here

    Ebean.save(cachedBean);

    // clear the cache
    ServerCache cachedBeanCountriesCache = cacheManager.getCollectionIdsCache(OCachedBean.class, "countries");
    cachedBeanCountriesCache.clear();
    Assert.assertEquals(0, cachedBeanCountriesCache.size());

    // load the cache
    OCachedBean dummyLoad = Ebean.find(OCachedBean.class, cachedBean.getId());
    List<Country> dummyCountries = dummyLoad.getCountries();
View Full Code Here

  public void test() {

    ResetBasicData.reset();

    ServerCache customerCache = Ebean.getServerCacheManager().getQueryCache(Customer.class);
    customerCache.clear();

    List<Customer> list = Ebean.find(Customer.class).setUseQueryCache(true).setReadOnly(true).where()
        .ilike("name", "Rob").findList();

    BeanCollection<Customer> bc = (BeanCollection<Customer>) list;
View Full Code Here

  public void test() {
   
    ResetBasicData.reset();
   
    ServerCache cache = Ebean.getServerCacheManager().getQueryCache(Country.class);
    cache.clear();

    Assert.assertEquals(0, cache.getStatistics(false).getSize());
   
    List<Country> countryList0 = Ebean.find(Country.class)
      .setUseQueryCache(true)
View Full Code Here

    EbeanServer server = Ebean.getServer(null);
    ServerCacheManager serverCacheManager = server.getServerCacheManager();
   
    // get cache, clear the cache and statistics
    ServerCache beanCache = serverCacheManager.getBeanCache(EInvoice.class);
    beanCache.clear();
    beanCache.getStatistics(true);
   
    // fetch and load the cache
    EInvoice invoice4 = Ebean.find(EInvoice.class)
        .where().idEq(invoice.getId())
View Full Code Here

    ResetBasicData.reset();

    // Need to make sure the customer cache is cleared for the later
    // asserts on the lazy loading
    ServerCache custCache = Ebean.getServerCacheManager().getBeanCache(Customer.class);
    custCache.clear();

    Query<Order> query = Ebean.find(Order.class).select("status")
    // .join("details","+query(10)")
        .fetch("customer", "+lazy(10) name, status").fetch("customer.contacts").orderBy().asc("id");
    // .join("customer.billingAddress");
View Full Code Here

  public void clearCache(String cacheKey) {

    ServerCache cache = concMap.get(cacheKey);
    if (cache != null) {
      cache.clear();
    }
  }
 
  /**
   * Return true if there is an active cache for this bean type.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.