搭配使用
mybatis与springboot整合的配置文件(application.properties):
https://blog.csdn.net/a755199443/article/details/91399442
sprinboot与spring data JPA整合配置文件(application.properties):
https://blog.csdn.net/a755199443/article/details/91635340
sprinboot与ehcache整合配置文件(在src/main/resources目录下)
文件名:application.properties
#配置数据源
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/ssm
spring.datasource.username=root
spring.datasource.password=root
#配置连接池
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#配置映射文件别名
mybatis.type-aliases-package=com.bjsxt.pojo
#配置springDataJPA相关设置
#配置正向工程
spring.jpa.hibernate.ddl-auto=update
#显示sql语句
spring.jpa.show-sql=truel
#配置ehcache配置文件路径
spring.cache.ehcache.cofnig=ehcache.xml
文件名:ehcache.xml
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../config/ehcache.xsd">
<diskStore path="java.io.tmpdir"/>
<!--defaultCache:echcache的默认缓存策略 -->
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="