gpt4 book ai didi

java - Hibernate 配置相当于 ehcache.xml

转载 作者:太空宇宙 更新时间:2023-11-04 06:09:46 24 4
gpt4 key购买 nike

是否有与 `ehcache.xml 等效的 Hibernate 配置?

最佳答案

不,没有。 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

关于java - Hibernate 配置相当于 ehcache.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28881578/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com