1、引入依赖
compile "org.hibernate:hibernate-ehcache"
2、application.yml增加配置
hibernate:
cache:
queries: false
use_second_level_cache: true
use_query_cache: false
region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory