### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
### The error may involve com.miaoshaproject.dao.UserPasswordDOMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: insert into user_password
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' 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 MySQL server version for the right syntax to use near '' at line 1] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
UserDOMapper.xml
id="insertSelective" 中添加
keyProperty="id" useGeneratedKeys="true" UserServiceImpl中 //实现model转成do(dataobject)方法 UserDO userDO=convertFormModel(userModel); userDOMapper.insertSelective(userDO); 后添加 userModel.setId(userDO.getId());
insertByPrimaryKey中加这个没:
keyProperty="id" useGeneratedKeys="true"