So an ORM layer maps tables to classes, rows to objects, and columns to attributes of those objects. Class methods are used to perform table-level operations, and instance methods perform operations on the individual rows.
In a typical ORM library, you supply configuration data to specify the mappings between things in the database and things in the program. Programmers using these ORM tools often find themselves creating and maintaining a boatload of XML configuration files.
In a typical ORM library, you supply configuration data to specify the mappings between things in the database and things in the program. Programmers using these ORM tools often find themselves creating and maintaining a boatload of XML configuration files.
本文介绍了对象关系映射(ORM)的基本概念,包括如何将数据库表映射为程序中的类,行映射为对象,列映射为属性。此外还讨论了使用类方法进行表级操作及实例方法对个别行的操作。文中提到了使用ORM库时常见的配置问题,例如通过XML文件来维护数据库与程序之间的映射关系。

被折叠的 条评论
为什么被折叠?



