spring测试save方法报错
2021-07-17 10:07
标签:int could rac strategy 策略 read native create generated 用test类测试service的save方法时,报错如下: 后经过调查,原因是实体类的自增主键写的有问题, 原写法: 现写法: 加上策略后,问题解决 spring测试save方法报错 标签:int could rac strategy 策略 read native create generated 原文地址:https://www.cnblogs.com/motong/p/9532176.html2018-08-24 21:52:13,506 - could not read a hi value
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘sell.hibernate_sequence‘ doesn‘t exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
@GeneratedValue
private Integer categoryId;
@GeneratedValue(strategy = GenerationType.IDENTITY) //设置主键生成模式为自增
private Integer categoryId;
上一篇:python 之路
下一篇:JavaSE——常用类