WORK IN PROGRESS RingoJS provides a storage framework that allows developers to provide different database backends while exposing the same interface to the application developer. Store implementations provide two interfaces: The application facing interface that provides a `defineEntity()` method to define persistent object constructors that can be used to create, retrieve, update, and delete persistent objects, and the internal [Store API] implementing the actual store functionality. Depending on the store implementation, the store's `defineEntity()` method takes one or two arguments: the name of the persistent class, and optionally an object describing the mapping of the persistent type. For example, the store implementations that are part of RingoJS [core modules](http://github.com/ringo/ringojs/tree/master/modules/ringo/storage) only take a type name as argument and will automatically persist any properties on persistent objects. var Person = store.defineEntity('Person'); On the other hand, the [ringo-hibernate package](http://github.com/robi42/ringo-hibernate) expects an object as second argument describing the mapping to a relational database table: var Person = store.defineEntity('Person', { table: 'persons', cacheable: false, properties: { firstName: {type: 'string', nullable: false}, lastName: {type: 'string', nullable: false}, birthDate: {type: 'timestamp', nullable: false}, birthYear: {type: 'integer'}, ssn: {type: 'string', unique: true}, vitae: {column: 'resume', type: 'text'} } });
Are you human? (yes/no)
cancel
|
markdown help
Revision history:
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→
v
→ Version
Home
Getting Started
Downloads
Screencasts
Documentation
API Master
API v0.8
Wiki
All Pages
Recent Changes
Contributing
Source Code
Community