前面有一篇博客说,springboot 2.0.3 jpa是存在问题的,后用springboot jpa 2.0.4 发现此问题已解决.springboot 2.0.4的jpa的sql看起来也比较容易理解,不再是日志中不再是hsql语句,而是传统sql,所以springboot jpa 2.0.4 用起来比之前版本好用的多,日志也好看懂的多,真的是开箱即用,另外,感觉springboot 2.0.4比springboot 2.0.3的jpa 灵活.springboot 2.0.4的jpa只需要加上
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
就可以了,application.properties
里面如下:
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
数据源不多说