12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- # 配置主键
- # 1. 设置 strategy 为 GenerationType.AUTO, 让jpa 选择合适方式匹配
- # 2. 在数据库内设置对应主键, 以及主键自增的规则
- # 各数据库
- # database
- spring-1:
- # MYSQL
- datasource:
- driver-class-name: com.mysql.cj.jdbc.Driver
- username: root
- password: mu123
- url: jdbc:mysql://127.0.0.1:3306/mjava?serverTimezone=Asia/Shanghai&useUnicode=yes&characterEncoding=UTF-8&useSSL=true
- # JPA
- jpa:
- database: MYSQL
- database-platform: org.hibernate.dialect.MySQL57Dialect
- # database
- spring-2:
- # sql_server
- spring:
- datasource:
- driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
- url: jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=DingTalkApprove
- username: sa
- password: Sa123456
- hikari:
- connection-init-sql: # SqlServer若设置类型不一致, 需关闭才可连接
- # JPA
- jpa:
- database: sql_server
- properties:
- hibernate:
- default_schema: dbo
- # 其他配置
- spring-3:
- jpa:
- hibernate:
- # 取消小驼峰到下划线映射
- naming:
- implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
- sphysical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|