官术网_书友最值得收藏!

What is ORM?

ORM stands for Object-Relational Mapping. ORM libraries map database tables to classes, rows of those tables to objects of the class, and columns to object attributes. Object wraps a row of a database table or view, encapsulates the database access, and adds domain logic on that data.

ORM connects business objects and database tables to create a domain model where logic and data are presented in one wrapping.

In addition, the ORM classes wrap our database tables to provide a set of class-level methods that perform table-level operations. For example, we might need to find the Employee with a particular ID. This is implemented as a class method that returns the corresponding Employee object. In Ruby code, this will look like:

employee= Employee.find(1)

This code will return an employee object whose ID is 1.

主站蜘蛛池模板: 杭锦后旗| 同仁县| 绥滨县| 井冈山市| 邢台县| 什邡市| 长丰县| 永和县| 剑河县| 鲁山县| 曲松县| 东乌珠穆沁旗| 广灵县| 文山县| 黑山县| 安溪县| 遂溪县| 长海县| 定陶县| 台州市| 沂南县| 尼玛县| 运城市| 郧西县| 盘山县| 古浪县| 元氏县| 修水县| 丰城市| 荥阳市| 江山市| 庆元县| 敦化市| 长宁区| 榆树市| 伊金霍洛旗| 昆山市| 阳原县| 微博| 永安市| 湾仔区|