Spring Boot JPA 在 TABLE 中插入带有 Hibernate 的大写名称 [英] Spring boot JPA insert in TABLE with uppercase name with Hibernate
本文介绍了Spring Boot JPA 在 TABLE 中插入带有 Hibernate 的大写名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表实体映射为:
i have a table entity mapped as :
@Entity
public class ItemsToRegister implements Serializable{
@Id
@Column(name = "ID_ITEM_TO_REGISTER")
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
.....
当我尝试在数据库中插入新记录时,表名被翻译成小写: items_to_register ,但我的表名是 ITEMS_TO_REGISTER如何在不更改 MySql 配置的情况下解决我的问题?(我的.cnf)
When i try to insert new record in database, the table name was translated in lowercase as : items_to_register , but my table name is ITEMS_TO_REGISTER How can i fix my problem without change MySql configuration? (my.cnf)
我的 application.properties 文件中有:
I have in my application.properties file :
spring.jpa.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.naming_strategy = org.hibernate.cfg.ImprovedNamingStrategy
推荐答案
在 hibernate 5 上,它会是
On hibernate 5, it would be
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
在您的 application.properties 文件中.
这篇关于Spring Boot JPA 在 TABLE 中插入带有 Hibernate 的大写名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文