![JAR search and dependency download from the Maven repository](/logo.png)
org.hibernate.cache.redis.hibernate4.util.HibernateCacheUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-redis Show documentation
Show all versions of hibernate-redis Show documentation
Hibernate 2nd cache provider with Redis
package org.hibernate.cache.redis.hibernate4.util;
import org.hibernate.SessionFactory;
import org.hibernate.internal.SessionFactoryImpl;
import org.hibernate.persister.entity.EntityPersister;
/**
* Hibernate 2nd cache Utility class
*
* @author [email protected]
*/
public final class HibernateCacheUtil {
private HibernateCacheUtil() {}
public static String getRegionName(SessionFactory sessionFactory,
Class entityClass) {
EntityPersister p = ((SessionFactoryImpl) sessionFactory).getEntityPersister(entityClass.getName());
if (p.hasCache()) {
return p.getCacheAccessStrategy().getRegion().getName();
}
return "";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy