- Spring boot jpa @Column命名大小写问题,
- Spring boot jpa @Column命名大小写问题
- Spring boot JPA column with inco
- Spring Boot+Spring Data JPA
- Spring Boot JPA ,Hibernate,Sprin
- 说一说 JPA + Oracle 项目启动时遇到一大坑,你碰到过
- SpringBoot2.0+Spring Data Jpa实现多
- spring boot+jpa演示id的生成策略及自定义id
- Spring Boot +Security+Redis+Vue构
- Spring Boot +Security+Redis+Vue构
一、问题
驼峰命名会被自动转成数据库下划线命名,指定@Column的name也不起作用
@Column(nullable = false,name = "resolvedDate")
private Timestamp resolvedDate;
resolvedDate会被转成resolved_date
二、解决方案
添加命名规则
在application.properties添加jpa属性:
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
网友评论