配置hibernate二级缓存(oscache)
1.导入oscache包。
2.sessionFactory结点中加入属性:
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.OSCacheProvider</prop>
3.在要实现缓存的bean.hbm.xml文件中加入
<cache usage="read-only"/>
4.src下面添加文件oscache.properies