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

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

Introduction

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

Prototype

@Override
public V putIfAbsent(K key, V value) 

Source Link

Usage

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

License:Apache License

private HQLQueryPlan putQueryPlanIfAbsent(SessionFactoryImplementor sfi, QueryPlanCacheKey cacheKey,
        HQLQueryPlan queryPlan) {/*www  .  j  a v  a  2  s  . c  o m*/
    BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> queryPlanCache = getQueryPlanCache(sfi);
    HQLQueryPlan oldQueryPlan = queryPlanCache.putIfAbsent(cacheKey, queryPlan);
    if (oldQueryPlan != null) {
        queryPlan = oldQueryPlan;
    }

    return queryPlan;
}