Class | DataMapper::Adapters::DataObjectsAdapter |
In: |
lib/dm-core/adapters/data_objects_adapter.rb
|
Parent: | AbstractAdapter |
DataObjectsAdapter is the base class for all adapers for relational databases. If you want to add support for a new RDBMS, it makes sense to make your adapter class inherit from this class.
By inheriting from DataObjectsAdapter, you get a copy of all the standard sub-modules (Quoting, Coersion and Queries) in your own Adapter. You can extend and overwrite these copies without affecting the originals.
For each model instance in resources, issues an SQL INSERT (or equivalent) statement to create a new record in the data store for the instance
Note that this method does not update identity map. A plugin needs to use adapter directly, it is up to plugin developer to keep identity map up to date.
@param [Enumerable(Resource)] resources
The list of resources (model instances) to create
@return [Integer]
The number of records that were actually saved into the database
@api semipublic
Constructs and executes DELETE statement for given query
@param [Collection] collection
collection of records to be deleted
@return [Integer]
the number of records deleted
@api semipublic
Constructs and executes UPDATE statement for given attributes and a query
@param [Hash(Property => Object)] attributes
hash of attribute values to set, keyed by Property
@param [Collection] collection
collection of records to be updated
@return [Integer]
the number of records updated
@api semipublic