Example usage for org.hibernate.internal.util.collections BoundedConcurrentHashMap get

List of usage examples for org.hibernate.internal.util.collections BoundedConcurrentHashMap get

Introduction

In this page you can find the example usage for org.hibernate.internal.util.collections BoundedConcurrentHashMap get.

Prototype

@Override
public V get(Object key) 

Source Link

Document

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Usage

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

License:Apache License

private CacheEntry<HQLQueryPlan> getQueryPlan(SessionFactoryImplementor sfi, Query query,
        QueryPlanCacheKey cacheKey) {/*from  w w  w. j  av  a  2s .c  o  m*/
    BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> queryPlanCache = getQueryPlanCache(sfi);
    HQLQueryPlan queryPlan = queryPlanCache.get(cacheKey);
    boolean fromCache = true;
    if (queryPlan == null) {
        fromCache = false;
        queryPlan = createQueryPlan(sfi, query);
    }

    return new CacheEntry<HQLQueryPlan>(queryPlan, fromCache);
}