是否有任何Hibernate配置相当于`ehcache.xml?
答案 0 :(得分:1)
不,没有。 Hibernate EhCacheRegionFactory尝试在加载时加载ehcache.xml
配置:
String configurationResourceName = null;
if ( properties != null ) {
configurationResourceName = (String) properties.get( NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME );
}
if ( configurationResourceName == null || configurationResourceName.length() == 0 ) {
final Configuration configuration = ConfigurationFactory.parseConfiguration();
manager = new CacheManager( configuration );
}
else {
final URL url = loadResource( configurationResourceName );
final Configuration configuration = HibernateEhcacheUtils.loadAndCorrectConfiguration( url );
manager = new CacheManager( configuration );
}
可以使用net.sf.ehcache.configurationResourceName属性配置ehcache.xml
资源:
net.sf.ehcache.configurationResourceName=/name_of_ehcache.xml