Comments (3)
数据库设计也是不要有数组的,字典的话,又是可以拆成对象的。操作数据库,还是按照数据库范式来
from jkdbmodel.
@ZYTSingleNoble @Haley-Wong 顺便问一下, 这种设计是不是要求库要具备表链接的功能?
例如:
@interface AClass : NSObject
{
//其它属性
...
//数组索引, 指向另外一个表(数组索引表, 每一个索引都指向另外一个表(详细的对象))
@property (nonatomic, assign) NSInteger bClassIndex;
}
//另一个文件
@interface BClass: NSObject
{
//一堆属性
...
}
问题描述的不准确, 麻烦两位有空帮忙解惑😄
from jkdbmodel.
@BillZong Sqlite 支持多表链接和左外链接。
提供一些思路:如果对象里包含其他对象属性的话,主要是利用runtime解析属性的时候,需要做一些判断和嵌套解析。然后在数据库表的增删改查的时候,根据属性是否包含其他对象来做表的关联查询。
补充:
但是如果对象的从属关系比较复杂的话,比如对象里包含A子对象,A子对象又包含B子对象......很多层的话,处理起来依然很麻烦。Sqlite 是个轻量级数据库,应该只用来缓存少量数据,不太建议缓存各种大量和太复杂关系的数据。
from jkdbmodel.
Related Issues (20)
- NSCoding
- 如何取得项目中已经存在的数据库文件
- 相同的数据save会重复插入数据库。是否可以插入的时候判断一下? HOT 2
- 切换文件夹后,怎么返回默认的文件夹呢 HOT 1
- 关于创建表的时机的问题 HOT 1
- 我存在的数据类型是float,比如3.14,但取出来却变成了3,求大神帮忙解决 HOT 1
- 关于查询的问题
- 无法 利用继承 ,添加父类的属性字段 到当前子类表中 HOT 3
- 个人对JKDB数组,float double 封装 HOT 6
- 主键问题
- 关于FMDBQueue的问题 HOT 2
- 关于查询数据的问题 HOT 1
- 不支持自定义主键
- 我往数据库存入了NSData数据类型,但是取出来的data却是空的 HOT 2
- 这个封装现在还维护吗?适合现在开发用吗? HOT 1
- 删除的方法有问题,删除肯定失败
- 查询有问题
- 异步update多条数据数据时,只update一条数据 HOT 1
- 老哥我想pull
- 请问,怎么给字段添加索引呢?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jkdbmodel.