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

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.

主站蜘蛛池模板: 盘山县| 河池市| 武陟县| 沅江市| 玛纳斯县| 云龙县| 会泽县| 顺平县| 昌吉市| 井研县| 汉阴县| 灵台县| 白沙| 福鼎市| 扎囊县| 应城市| 通江县| 前郭尔| 无为县| 闵行区| 卓尼县| 柳河县| 瓦房店市| 垣曲县| 安吉县| 陆良县| 五峰| 邯郸县| 凌源市| 虞城县| 皮山县| 壤塘县| 贡嘎县| 芒康县| 榕江县| 区。| 依兰县| 个旧市| 深水埗区| 扎鲁特旗| 藁城市|