报错时间
2020年4月24日11:28:02
报错场景
使用Mybatis向MySQL数据库添加数据
报错代码和错误信息
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'productid' in 'class cn.yys.mybatis01.Product'
### The error may exist in ProductMapper.xml
### The error may involve cn.yys.mybatis01.ProductMapper.addProduct-Inline
### The error occurred while setting parameters
### SQL: insert into product(ProductId,ProductName,UnitPrice,UnitsInStock,ProductDesc) values (?,?,?, ?,?)
报错原因
Java实体类和XML映射之间的名字不匹配