qq_罪名_1
2019-02-18 17:25
user_info表不能获取到user_passworrd表的id值
查看是不是在
参看是不是在public void register(UserModel userModel) throws BusinessException {方法中缺少userModel.setId(userDO.getId());
我的代码也是写成了:
private UserPasswordDO convertPasswordFromModel(UserModel userModel){
if (userModel == null) {
return null;
}
UserPasswordDO userPasswordDO = new UserPasswordDO();
userPasswordDO.setEncrptPassword(userModel.getEncrptPassword());
userPasswordDO.setUserId(userModel.getId());
return userPasswordDO;
}
具体应该是改写成什么样的?多谢你。
//UserPasswordModel转成dataobject private UserPasswordDO convertPasswordFromModel(UserModel userModel){ if (userModel == null){ return null; } UserPasswordDO userPasswordDO = new UserPasswordDO(); userPasswordDO.setEncrptPassword(userModel.getEncrptPassword()); return userPasswordDO; }
检查下这一句,setUserId给密码模型 我原来也是无法将两者id关联,最后发现是把那句代码写成了
userPasswordDO.setId(userModel.getId());
注册没问题
SpringBoot构建电商基础秒杀项目
49064 学习 · 954 问题
相似问题