java – Eclipselink Mysql表名大写

我有两个实体类Member和EvaluationType.它们是关系表.

成员:

@ManyToOne
@JoinColumn(name = "evaluationId")
private EvaluationType evaluationType;

评估类型:

 @OneToMany(mappedBy = "evaluationType", cascade = CascadeType.ALL)
 private List<Member> memberList;

当我运行应用程序时,我收到以下错误:

错误代码:1215
调用:ALTER TABLE MEMBER ADD CONSTRAINT FK_MEMBER_evaluationId FOREIGN KEY(evaluationId)REFERENCESEVALUATİONTYPE(evaluationId)
查询:DataModifyQuery(sql =“ALTER TABLE MEMBER ADD CONSTRAINT FK_MEMBER_evaluationId FOREIGN KEY(evaluationId)REFERENCESEVALUATİONTYPE(evaluationId)”)

错误是“EVALUATİONTYPE”表名.因为mysql中没有大写表名.我怎样才能解决这个问题?

最佳答案
另一种选择是在数据库本身中设置区分大小写.检查https://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
lower_case_table_names = 1将以小写形式存储所有表名,并使名称比较不区分大小写.
但@Table注释也应该起作用.所以这取决于你.

转载注明原文:java – Eclipselink Mysql表名大写 - 代码日志