SpringBoot整合Mybatis時遇到“ Transactional cannot be resolved to a type ” ,以為是沒有導入相應的包 “ import org.springframework.transaction.annotation.Transactional; ” ,導入發現還是報錯,在Stack Overflow上找到解決辦法。在pom.xml中加入
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.2.6.RELEASE</version>
</dependency>