开发者社区 问答 正文

model.save()报错The attribute name is not ?报错

@JFinal 你好,想跟你请教个问题:我的表里面没有id字段,有个uid主键,自增。在使用.save()的时候,就报错:The attribute name is not exists: id。请问这是怎么回事呢》?

展开
收起
爱吃鱼的程序员 2020-06-22 15:00:14 402 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    引用来自“RobertCool”的答案

    主键名需要为id,或者在Config类中设置表主键名称+1,多谢了,又学到了。+1主键名需要为id,或者在Config类中设置表主键名称

    nameisnotexists

    ....

    2020-06-22 15:00:30 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等