springboot整合JPA

请参考之前springboot整合mybatis的创建过程

https://www.cnblogs.com/-217/p/14364328.html

创建项目,把选择项将mybatis改为JPA即可,其他不变

JPA配置文件如下

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/ssm?characterEncoding=UTF-8&&serverTimezone=GMT
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver
  jpa:
    hibernate:
      #     更新或者创建数据表结构 ddl:增删改 dml:表创建 dcl:权限 dql:查询
      ddl-auto: update
    #    控制台显示SQL
    show-sql: true

  thymeleaf:
    cache: false
    mode: LEGACYHTML5
  mvc:
    date-format: yyyy-MM-dd
server:
  port: 8090
原文地址:https://www.cnblogs.com/-217/p/14366604.html