此卡片不在当前主题的阅读序列中,可返回主题继续阅读。
知识卡片
ORM映射表与对象
对象关系映射器(ORM)把数据库表与程序对象关联,开发者可通过类、属性和方法操作数据模型。它简化了对象层的表达,但不会自动消除数据库结构、事务和查询成本的约束;这些仍需在数据层明确处理。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 7 章《Service implementation patterns for microservices》(源文件:_epub-src/OEBPS/Text/07.htm)
- 结论依据:原文以 SQLAlchemy 为例说明 ORM 将表映射为类,使字段以属性访问,并可在模型上加入方法。
- 原始内容:An ORM is a framework that implements the data mapper pattern, which allows us to map the tables in our database to objects. ... using an ORM makes it easier to manage our data since it gives us a class interface to the tables in the database.