ActiveRecord.jsJavaScript 对象映射框架
ActiveRecord.js 是一个开源的JavaScript 对象映射框架,包括:
- Google Gears (client-side persistence)
- In Memory (if no SQL server is available on the client)
- Adobe AIR (client-side persistence)
- SQLite and MySQL (via Aptana Jaxer, the open source Ajax server)
- additional environments (like HTML5) expected to come through working with the community on the project
ActiveRecord.js abstracts away underlying SQL commands so that JavaScript developers can have a unified API for storing, finding, selecting and retrieving objects and their data using the ActiveRecord pattern popularized by the Ruby on Rails community.
示例代码:
- var User = ActiveRecord.define('users',{
- username: '',
- email: ''
- });
- User.hasMany('articles');
- var ryan = User.create({
- username: 'ryan',
- email: 'rjohnson@aptana.com'
- });
- var Article = ActiveRecord.define('articles',{
- name: '',
- body: '',
- user_id: 0
- });
- Article.belongsTo('user');
- var a = Article.create({
- name: 'Announcing ActiveRecord.js',
- user_id: ryan.id
- });
- a.set('name','Announcing ActiveRecord.js!!!');
- a.save();
- a.getUser() == ryan;
- ryan.getArticleList()[0] == a;
评论
DoctrinePHP对象映射框架
Doctrine是一个PHP的ORM(对象关联映射框架),基于强大的DBAL(数据库抽象层)。其中一个最主要的功能就是使用面向对象的方式执行数据库查询,受HibernateHQL的影响,Doctrin
DoctrinePHP对象映射框架
0
MorphiaMongoDB 对象映射框架
Morphia是一个轻量级的类型安全的Java类库,用来将在MongoDB和Java对象之间进行映射。@Entity("employees")classEmployee{ @IdObjectIdid;
MorphiaMongoDB 对象映射框架
0
SequelRuby对象映射框架
Sequel是一个Ruby语言的对象映射框架(ORM),提供了线程安全、连接池以及DSL语言用来构造查询和表模型。示例代码:require"rubygems"require"sequel"#conne
SequelRuby对象映射框架
0