SpringData-Jpa-Base
在 springBoot 构建
1 构建项目
1.1 依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
1.2 配置
1.2.1 示例
spring:
datasource:
url: jdbc:mysql://127.0.0.1/spring_data_jpa?useSSL=false&useUnicode=true&characterEncoding=utf8&autoReconnect=true
username: root
password: a
driver-class-name: com.mysql.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: true
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect # 指定为innodb引擎