以后可以在领域中更改主键吗?

编程入门 行业动态 更新时间:2024-10-14 22:15:39
本文介绍了以后可以在领域中更改主键吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在本地设置了一个临时主键,然后将对象保存到域中,然后服务器为该对象分配了唯一键,然后我想为该对象更新主键.

I set a temporary primary locally and save the object to realm, and later the server assigns a unique key for the object and then I want to update the primary key for the object.

那么可以重新分配对象的主键吗?当我们为对象重新分配主键时会发生什么?它将使用旧的主键保存对象吗?

So is it possible to reassign a primary key for the object? And what happens when we reassign a primary key to the object? Will it save the object with the old primary key?

推荐答案

可以将主键的值更改为Realm 1.2.0.

It is possible to change the value of a primary key up to Realm 1.2.0.

从Realm 2.0.x开始,禁止更改主键值.

It is prohibited to change primary key value since Realm 2.0.x.

更多推荐

以后可以在领域中更改主键吗?

本文发布于:2023-11-25 02:21:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627933.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:主键   领域

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!