【发布时间】:2019-03-31 15:37:28
【问题描述】:
我正在使用 spring boot 和 jpa hibernate 在我的数据库中创建一些表,但它引发了一个我不太了解的奇怪异常。
@Entity
public class Option {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String marca;
private String model;
private String anFabrDeLa;
private String anFabrPanaLa;
private String pretDeLa;
private String pretPanaLa;
private String oras;
private int score;
//constructors, getters and setters
}
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option (id integer not null, an_fabr_de_la varchar(255), an_fabr_pana_la varchar' at line 1
我尝试使用@Column(name='something'),但它仍然给我这个奇怪的错误...
【问题讨论】:
标签: hibernate spring-boot jpa