Module storable
Base class for mapping JavaScript objects to relational databases.
Storable (props)
Creates a new Storable instance. This constructor must not be called
directly, instead define an entity by calling Store.prototype.defineEntity()
which returns a constructor function implementing this Storable interface.
This constructor function can then be used for creating instances of
the defined entity.
Parameters
Object | props | Optional object containing the initial property values of the storable instance |
Storable.prototype._id
The ID of this storable (null for transient storables)
Storable.prototype.save ()
Saves this storable in the underlying database. Use this method for both persisting a transient storable or for storing modifications in an already persisted storable.
Returns
undefined |
Storable.prototype.toJSON ()
Returns a JSON representation of this storable. Note that this method does not recurse, i.e. the resulting object does not contain mapped objects or collections.
Returns
Object |