Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostId #10

Open
fjliang opened this issue Oct 12, 2015 · 2 comments
Open

hostId #10

fjliang opened this issue Oct 12, 2015 · 2 comments

Comments

@fjliang
Copy link

fjliang commented Oct 12, 2015

对于“核心字段:hostID是服务器主键,任何使用CoreModel的模型必须拥有唯一的hostID,如果您没有hostID,请构建。” 我看过demo后,有几个问题不是太明白,请教一下:
1.你怎么知道hostID对应服务器中的哪个字段
2.支持多个主键吗?联合主键
3.怎么构建hostID

@CharlinFeng
Copy link
Owner

1.hostID对应id这个key,你也可以修改。
2.对于hostID只需确定唯一性即可。多主键没有考虑。
3.构建hostID比较麻烦,常用方法可以使用表的总记录数作为最新数据的hostID,然后或者是上一条数据的hostID + 1

@comrade110
Copy link

hostId其实可以用NSString替代 毕竟有一些ID键值不是单纯int类型

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants