Example usage for org.hibernate.engine.query.spi QueryPlanCache DEFAULT_QUERY_PLAN_MAX_COUNT

List of usage examples for org.hibernate.engine.query.spi QueryPlanCache DEFAULT_QUERY_PLAN_MAX_COUNT

Introduction

In this page you can find the example usage for org.hibernate.engine.query.spi QueryPlanCache DEFAULT_QUERY_PLAN_MAX_COUNT.

Prototype

int DEFAULT_QUERY_PLAN_MAX_COUNT

To view the source code for org.hibernate.engine.query.spi QueryPlanCache DEFAULT_QUERY_PLAN_MAX_COUNT.

Click Source Link

Document

The default soft reference count.

Usage

From source file:com.blazebit.persistence.integration.hibernate.base.HibernateExtendedQuerySupport.java

License:Apache License

private BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> getQueryPlanCache(
        SessionFactoryImplementor sfi) {
    BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> queryPlanCache = queryPlanCachesCache.get(sfi);
    if (queryPlanCache == null) {
        queryPlanCache = new BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan>(
                QueryPlanCache.DEFAULT_QUERY_PLAN_MAX_COUNT, 20, BoundedConcurrentHashMap.Eviction.LIRS);
        BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> oldQueryPlanCache = queryPlanCachesCache
                .putIfAbsent(sfi, queryPlanCache);
        if (oldQueryPlanCache != null) {
            queryPlanCache = oldQueryPlanCache;
        }//w w  w  .  j a va  2 s  .c o m
    }

    return queryPlanCache;
}