I have two entity classes Member and EvaluationType. They are relational tables.
Member :
@ManyToOne
@JoinColumn(name = "evaluationId")
private EvaluationType evaluationType;
Evaluation Type :
@OneToMany(mappedBy = "evaluationType", cascade = CascadeType.ALL)
private List<Member> memberList;
When I run the application I am getting following error :
Error Code: 1215 Call: ALTER TABLE MEMBER ADD CONSTRAINT FK_MEMBER_evaluationId FOREIGN KEY (evaluationId) REFERENCES EVALUATİONTYPE (evaluationId) Query: DataModifyQuery(sql="ALTER TABLE MEMBER ADD CONSTRAINT FK_MEMBER_evaluationId FOREIGN KEY (evaluationId) REFERENCES EVALUATİONTYPE (evaluationId)")
Error is "EVALUATİONTYPE" table name. Because There is no upper case table name in mysql. HOw can I fix this?
Another option is to set case sensitivity in database itself. Check https://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html lower_case_table_names=1 will store all table names in lowercase and make name comparison to be not case sensitive. But @Table annotation shall work too. So it's up to you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.