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

关于创建表的时机的问题 #44

Open
lcztt opened this issue Feb 10, 2017 · 1 comment
Open

关于创建表的时机的问题 #44

lcztt opened this issue Feb 10, 2017 · 1 comment

Comments

@lcztt
Copy link

lcztt commented Feb 10, 2017

你好,我们公司原产品使用的数据库就是:SQLitePersistentObject,现在因为SQLitePersistentObject很久不更新了,而且遇到多线程时会出现bug,所以新产品开发时选择了替换成JKDBModel,在使用JKDBModel过程中遇到一个问题,问题场景:客户端多个聊天窗口使用多张表存储,多张表继承同一个父类,使用runtime生成子表对应的类。现在的问题是,在使用运行时生成子表对应的类时,JKDBModel在
+initialize 方法中调用了创建表的方法,生成的表的名称是对应的父类的,不是对应子类的。我尝试将生成表的方法调用延迟到 -init 方法中,遇到一个位置错误,代码执行不通过。请问能否参照 SQLitePersistentObject 在操作对应表之前检查该表是否创建,若没有创建,先创建表,在执行对应的语句?

@Haley-Wong
Copy link
Owner

那可能需要做一些修改,通过CreateTable里的SQL语句可以判断表是否存在。

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

2 participants