HHH-9975 CacheImpl.containsQuery(String) does not check if query cache is enabled

This commit is contained in:
Brett Meyer 2015-08-26 16:37:09 -04:00
parent 5f5e5f82c4
commit eaf4c789b3
1 changed files with 11 additions and 7 deletions

View File

@ -6,12 +6,6 @@
*/
package org.hibernate.internal;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.hibernate.HibernateException;
import org.hibernate.boot.spi.SessionFactoryOptions;
import org.hibernate.cache.spi.QueryCache;
@ -27,6 +21,12 @@ import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* @author Strong Liu <stliu@hibernate.org>
*/
@ -200,7 +200,11 @@ public class CacheImpl implements CacheImplementor {
@Override
public boolean containsQuery(String regionName) {
if ( sessionFactory.getSessionFactoryOptions().isQueryCacheEnabled() ) {
return queryCaches.containsKey(regionName);
} else {
return false;
}
}
@Override