Package org.hibernate.cache

Examples of org.hibernate.cache.QueryCache


      final SessionImplementor session,
      final QueryParameters queryParameters,
      final Set querySpaces,
      final Type[] resultTypes) {
 
    QueryCache queryCache = factory.getQueryCache( queryParameters.getCacheRegion() );
   
    Set filterKeys = FilterKey.createFilterKeys(
        session.getEnabledFilters(),
        session.getEntityMode()
      );
View Full Code Here


    if ( settings.isQueryCacheEnabled() )  {
      queryCache.destroy();

      iter = queryCaches.values().iterator();
      while ( iter.hasNext() ) {
        QueryCache cache = (QueryCache) iter.next();
        cache.destroy();
      }
      updateTimestampsCache.destroy();
    }

    settings.getRegionFactory().stop();
View Full Code Here

    if ( !settings.isQueryCacheEnabled() ) {
      return null;
    }

    synchronized ( allCacheRegions ) {
      QueryCache currentQueryCache = ( QueryCache ) queryCaches.get( regionName );
      if ( currentQueryCache == null ) {
        currentQueryCache = settings.getQueryCacheFactory().getQueryCache( regionName, updateTimestampsCache, settings, properties );
        queryCaches.put( regionName, currentQueryCache );
        allCacheRegions.put( currentQueryCache.getRegion().getName(), currentQueryCache.getRegion() );
      }
      return currentQueryCache;
    }
  }
View Full Code Here

      throw new NullPointerException("use the zero-argument form to evict the default query cache");
    }
    else {
      synchronized (allCacheRegions) {
        if ( settings.isQueryCacheEnabled() ) {
          QueryCache currentQueryCache = (QueryCache) queryCaches.get(cacheRegion);
          if ( currentQueryCache != null ) {
            currentQueryCache.clear();
          }
        }
      }
    }
  }
View Full Code Here

    if ( settings.isQueryCacheEnabled() )  {
      queryCache.destroy();

      iter = queryCaches.values().iterator();
      while ( iter.hasNext() ) {
        QueryCache cache = (QueryCache) iter.next();
        cache.destroy();
      }
      updateTimestampsCache.destroy();
    }

    settings.getRegionFactory().stop();
View Full Code Here

    if ( !settings.isQueryCacheEnabled() ) {
      return null;
    }

    QueryCache currentQueryCache = queryCaches.get( regionName );
    if ( currentQueryCache == null ) {
      currentQueryCache = settings.getQueryCacheFactory().getQueryCache( regionName, updateTimestampsCache, settings, properties );
      queryCaches.put( regionName, currentQueryCache );
      allCacheRegions.put( currentQueryCache.getRegion().getName(), currentQueryCache.getRegion() );
    }
    return currentQueryCache;
  }
View Full Code Here

    if (cacheRegion==null) {
      throw new NullPointerException("use the zero-argument form to evict the default query cache");
    }
    else {
      if ( settings.isQueryCacheEnabled() ) {
        QueryCache currentQueryCache = (QueryCache) queryCaches.get(cacheRegion);
        if ( currentQueryCache != null ) {
          currentQueryCache.clear();
        }
      }
    }
  }
View Full Code Here

      final SessionImplementor session,
      final QueryParameters queryParameters,
      final Set querySpaces,
      final Type[] resultTypes) {
 
    QueryCache queryCache = factory.getQueryCache( queryParameters.getCacheRegion() );
   
   
    QueryKey key = generateQueryKey( session, queryParameters );
    if ( querySpaces == null || querySpaces.size() == 0 ) {
      log.trace( "unexpected querySpaces is "+( querySpaces == null ? "null" : "empty" ) );
View Full Code Here

      final SessionImplementor session,
      final QueryParameters queryParameters,
      final Set querySpaces,
      final Type[] resultTypes) {
 
    QueryCache queryCache = factory.getQueryCache( queryParameters.getCacheRegion() );
   
    Set filterKeys = FilterKey.createFilterKeys(
        session.getEnabledFilters(),
        session.getEntityMode()
      );
View Full Code Here

      throw new NullPointerException("use the zero-argument form to evict the default query cache");
    }
    else {
      synchronized (allCacheRegions) {
        if ( settings.isQueryCacheEnabled() ) {
          QueryCache currentQueryCache = (QueryCache) queryCaches.get(cacheRegion);
          if ( currentQueryCache != null ) {
            currentQueryCache.clear();
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.QueryCache

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.