我有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);