我在创建商品添加到数据库时,使用insertSelective()方法,也设置主键自增了,为何会报下面的错误,xml文件是代码生成器生成的,useGeneratedKeys和keyProperty我也写了
### The error may involve com.miaosha.dao.ItemMapper.insertSelective-Inline### The error occurred while setting parameters### SQL: > insert into item ( title, price, description, img_url ) values ( ?, ?, ?, ? )
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>
insert into item ( title, price, ' at line 1;
bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>
insert into item ( title, price, ' at line 1]