解决fail to convert property value of type错误

default message [Failed to convert property value of type [java.lang.String] to required type [int] for property xxx
报错

原因:
数据库中定义的字段为int类型,是为了方便自增长。在前端页面得到的数据一般是string,所以会把实体类中对应属性定义为string,用于接收,根据需求处理。
而数据库与实体类之间,会通过resultmap进行关系映射,所以不必有顾虑。

早点认识到这一点,就不会找了好久别的方法还解决不了了!!!

extern void bootupGetIccid(RILChannelCtx *p_channel) { 1477 int result = 0; 1478 char hashedIccid[PROPERTY_VALUE_MAX] = { 0 }; 1479 ATResponse *p_response = NULL; 1480 int err = at_send_command_singleline("AT+ICCID?", "+ICCID:", &p_response, p_channel); 1481 RIL_SOCKET_ID rid = getRILIdByChannelCtx(p_channel); 1482 if (err >= 0 && p_response != NULL) { 1483 if (at_get_cme_error(p_response) == CME_SUCCESS) { 1484 char *line; 1485 char *iccId; 1486 line = p_response->p_intermediates->line; 1487 err = at_tok_start (&line); 1488 if (err >= 0) { 1489 err = at_tok_nextstr(&line, &iccId); 1490 if (err >= 0) { 1491 char maskIccid[PROPERTY_VALUE_MAX] = {0}; 1492 givePrintableIccid(iccId, maskIccid); 1493 RLOGD("bootupGetIccid[%d] iccid is %s", rid, maskIccid); 1494 // Convert all the lower case characters in iccid to upper case 1495 stringToUpper(iccId); 1496 hash256(iccId, hashedIccid, PROPERTY_VALUE_MAX); 1497 property_set(PROPERTY_ICCID_SIM[rid], hashedIccid); 1498 RLOGD("bootupGetIccid,rid: %d, iccid: %s", rid, hashedIccid); 1499 RIL_UNSOL_RESPONSE(RIL_UNSOL_ICCID_CHANGED, iccId, strlen(iccId), rid); 1500 result = 1; 1501 } else 1502 RLOGD("bootupGetIccid[%d]: get iccid error 2", rid); 1503 } else { 1504 RLOGD("bootupGetIccid[%d]: get iccid error 1", rid); 1505 } 1506 } else { 1507 RLOGD("bootupGetIccid[%d]: Error or no SIM inserted!", rid); 1508 } 1509 } else { 1510 RLOGE("bootupGetIccid[%d] Fail", rid); 1511 } 1512 at_response_free(p_response); 1513 1514 if (!result) { 1515 RLOG
03-25
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值