简体   繁体   English

无法在spring数据jpa中创建大写的表

[英]Unable to create Table with upper case in spring data jpa

I am using spring-data-jpa for my project, it handles creating the database, when i was working on my machine which is windows everything was fine, but when deploying to linux machine the application broke saying table could not be found 我正在为我的项目使用spring-data-jpa,它可以处理创建数据库的问题,当我在Windows的机器上工作时一切都很好,但是当部署到linux机器时,应用程序坏了,无法找到表

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'sframele_levelsDB.Store' doesn't exist

table name is case sensitive in linux machines and for some reason even I am specifying in my entity the table name to be lowercase jpa is looking for Store not store 表名称在linux机器中区分大小写,并且由于某种原因,即使我在我的实体中将表名称指定为小写jpa也在寻找Store not store

@Entity
@Table(name="store")
public class Store {

I tried to change the name to Store 我试图将名称更改为Store

@Entity
@Table(name="Store")
public class Store {

but the created table still lowercase, i tried several naming strategies but did not work 但是创建的表仍然是小写,我尝试了几种命名策略,但是没有用

  spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy

also tried 也尝试过

 spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

Any help is appreciated 任何帮助表示赞赏

Use 采用

@Table(name="`Store`")

instead. 代替。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM