springboot向mysql插入数据错误

用springboot自动持久化bean,错误:

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement
名为Vote.java的bean是这样写的:

@Entity
public class Vote {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Integer iid;
    private Long vid;
    private String option;
    private int count;

错误原因&解决办法:

option 应该是mysql的保留字,具体没有查。所以把option换成别的名字就成功了。这个错误提示信息太不具体了,追查原因花了好多小时(╯▔皿▔)╯。

你可能感兴趣的:(spring,boot,mysql,java,spring,boot)