hibernate缓存
4.1 一级缓存
session
4.2 二级缓存
SessionFactory
可拔插式
hibernate(5.2.12.Final)中使用二级缓存步骤(ehcache)
5.1 导入ehcache相关依赖
org.hibernate
hibernate-ehcache
5.2.12.Final
5.2 src添加ehcache.xml
5.3 hibernate.cfg.xml中添加二级缓存相关配置
true
true
org.hibernate.cache.ehcache.EhCacheRegionFactory
5.4 指定实体类开启二级缓存
<!-- xml配置方式 -->
<class table="t_sys_dict" name="entity.Dict">
<cache usage="read-write"/>
.......
</class>
注1:查全部需要编写代码来开启二级缓存的
query.setCacheRegion("entity.Dict");//指定缓存策略,名字必须实体类的完整类名
query.setCacheable(true);//手动开启二级缓存
12345678910
log4j2
异步
slf4j 抽象的日志系统
slf4j
log4j/log4j2/common logging
---------------------
作者:你妈嗨
来源:CSDN
原文:https://blog.csdn.net/qq_43226989/article/details/84776760
版权声明:本文为博主原创文章,转载请附上博文链接!