ORM与Ruby on Rails有什么关系? [英] What is ORM as related to Ruby on Rails?

查看:94
本文介绍了ORM与Ruby on Rails有什么关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是适用于Rails的ORM?它是什么意思?

What is ORM as it applies to Rails and what does it mean?

推荐答案

ORM是对象关系映射器.这意味着您不必自己手动调用数据库. ORM会为您处理.

ORM is Object Relational Mapper. It means you don't have to manually call the database yourself; the ORM handles it for you.

Ruby on Rails使用一个叫做ActiveRecord的,这是一个非常好的.

Ruby on Rails uses one called ActiveRecord, and it's a really good one.

ORM允许您执行以下操作:

ORM allows you to do things such as:

User.find(50).contacts

而不是使用JOIN,WHERE等手动编写SELECT语句.

Instead of manually writing a SELECT statement with JOINs, WHEREs, etc.

这篇关于ORM与Ruby on Rails有什么关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆