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

可以自定义主键吗 #823

Open
yilylong opened this issue Jun 27, 2023 · 1 comment
Open

可以自定义主键吗 #823

yilylong opened this issue Jun 27, 2023 · 1 comment

Comments

@yilylong
Copy link

目前主键都是自己创建的ID自增,现在的精准查询方法都是传需要ID,感觉有局限性。

@yilylong
Copy link
Author

class TestA:LitePalSupport() {
var _id=0L
var ID =0L
var v1 = ""
var v2 = ArrayList()
}
无论我定义成_id 还是 ID 查询出来都会自动将表主键id赋值给它们,要是数据是从服务端获取且id后端定义好的如何存储呢?如果定义成val 如果要动态创建对象或者接口解析对象我又如何赋值呢?

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

1 participant