慢羊羊的快发明 2019-01-14 22:06 采纳率: 0%
浏览 1659
已结题

SpringBoot1.5.18 Cacheable不起作用,为什么,求解

代码:

@Service
public class EmployeeService {

    @Autowired
    EmployeeMapper employeeMapper;

 @Cacheable(cacheNames = {"emp"})
    public  Employee getEmp(Integer id){

        System.out.println("查询"+id+"号员工");
        return employeeMapper.getEmployee(id);
    }

配置:

spring.datasource.url=jdbc:mysql://localhost:3306/spring_cache
spring.datasource.username=xxx
spring.datasource.password=xsg5207896
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#        开启驼峰命名规则
mybatis.configuration.map-underscore-to-camel-case=true

logging.level.com.example.sbcache.mapper=debug

我看别人都是这么写的,为什么我的都不得行呢 求解 工具idea

  • 写回答

3条回答 默认 最新

  • devmiao 2019-01-14 23:57
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试