Java Hibernate异常MySQLSyntaxErrorException:您的SQL语法中有错误

时间:2015-08-20 13:46:35

标签: java mysql hibernate

我有hibernate实体,当我尝试将其插入MySQL数据库时,我得到异常:

{id,title}

当我尝试使用hibernate插入MySQL数据库时:

@Entity
public class Pick {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int pid;

@OneToOne
private Match_soccer match;

@OneToOne
private Algo1 algo;

@Column(length = 100)
private String pick;

@Column(length = 5)
private double limit;
...

我得到MySQL异常:

Pick pick = new Pick();
pick.setMatch(match);
pick.setAlgo(a);
pick.setLimit(2.5);
pick.setPick("under");

PickDAO pd = new PickDAO();
pd.insertMatch(pick);

1 个答案:

答案 0 :(得分:3)

LimitMySQL reserved word。将实体属性重命名为其他内容