多租户版本 删除修改获取不到id

提问 5 1126
版本:renren-security 开发环境:
img[//cdn.renren.io/5dd93201907301128454988.jpg] 数据库表中 第一个字段是否必须命名为id 实体类中 去除继承 无id字段 前端无法将careId传入后台 请问怎么设置
回帖
  • 需要使用id,不然很多代码就不能通用,这也是比较好的习惯
    0
  • 一缕阳光
    2019-07-30
    仍然报错 2019-07-30 11:56:12.844 DEBUG 19884 --- [nio-8080-exec-2] i.r.m.log.dao.SysLogOperationDao.insert : ==> Preparing: INSERT INTO sys_log_operation ( id, operation, request_uri, request_method, request_params, request_time, user_agent, ip, status, creator_name, creator, create_date ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) 2019-07-30 11:56:12.844 DEBUG 19884 --- [nio-8080-exec-2] i.r.m.log.dao.SysLogOperationDao.insert : ==> Parameters: 1156050838088028161(Long), 保存(String), /renren-admin/cude/cubecardcode/(String), POST(String), {"cardAccount":"1","cardId":"","cardPassword":"1","cardPasswordOne":"1","cardType":1,"isUse":1}(String), 24(Integer), Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134(String), 127.0.0.1(String), 0(Integer), admin(String), 1067246875800000001(Long), 2019-07-30 11:56:12.843(Timestamp) 2019-07-30 11:56:12.845 DEBUG 19884 --- [nio-8080-exec-2] i.r.m.log.dao.SysLogOperationDao.insert : <== Updates: 1 2019-07-30 11:56:12.848 ERROR 19884 --- [nio-8080-exec-2] i.r.c.exception.RenExceptionHandler : nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class io.renren.modules.cude.entity.CubeCardCodeEntity' with value '1156050838037696514' Cause: java.lang.IllegalArgumentException: argument type mismatch org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class io.renren.modules.cude.entity.CubeCardCodeEntity' with value '1156050838037696514' Cause: java.lang.IllegalArgumentException: argument type mismatch at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy70.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:64) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) img[//cdn.renren.io/f84ef201907301157493621.jpg]
    0
  • @一缕阳光 看报错信息,CubeCardCodeEntity 没有id
    0
  • 一缕阳光
    2019-07-30
    有id也不行 代码及日志如下 求帮忙看看 @Data @EqualsAndHashCode(callSuper=false) @TableName("cube_card_code") public class CubeCardCodeEntity { @TableId private Integer id; /** * 卡密表id */ private String cardId; /** Total: 69 2019-07-30 13:41:33.464 DEBUG 20988 --- [io-8080-exec-13] i.r.m.log.dao.SysLogOperationDao.insert : ==> Preparing: INSERT INTO sys_log_operation ( id, operation, request_uri, request_method, request_params, request_time, user_agent, ip, status, creator_name, creator, create_date ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) 2019-07-30 13:41:33.466 DEBUG 20988 --- [io-8080-exec-13] i.r.m.log.dao.SysLogOperationDao.insert : ==> Parameters: 1156077348689707009(Long), 保存(String), /renren-admin/cude/cubecardcode/(String), POST(String), {"cardAccount":"1","cardId":"","cardPassword":"1","cardPasswordOne":"1","cardType":1,"isUse":1}(String), 12(Integer), Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36(String), 0:0:0:0:0:0:0:1(String), 0(Integer), 小魔方(String), 1156029074809282561(Long), 2019-07-30 13:41:33.463(Timestamp) 2019-07-30 13:41:33.471 DEBUG 20988 --- [io-8080-exec-13] i.r.m.log.dao.SysLogOperationDao.insert : <== Updates: 1 2019-07-30 13:41:33.475 ERROR 20988 --- [io-8080-exec-13] i.r.c.exception.RenExceptionHandler : nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class io.renren.modules.cude.entity.CubeCardCodeEntity' with value '1156077348681318402' Cause: java.lang.IllegalArgumentException: argument type mismatch org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class io.renren.modules.cude.entity.CubeCardCodeEntity' with value '1156077348681318402' Cause: java.lang.IllegalArgumentException: argument type mismatch at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
    0
  • @一缕阳光 id需要是Long类型
    0
本帖已结贴