--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: []

comment: 
- !ruby/struct:SM::Flow::P 
  body: The identity_map plugin allows the user to create temporary identity maps via the with_identity_map method, which takes a block. Inside the block, objects have a 1-1 correspondence with rows in the database.
- !ruby/struct:SM::Flow::P 
  body: "For example, the following is true, and wouldn't be true if you weren't using the identity map:"
- !ruby/struct:SM::Flow::VERB 
  body: "  Sequel::Model.with_identity_map do\n    Album.filter{(id &gt; 0) &amp; (id &lt; 2)}.first.object_id == Album.first(:id=&gt;1).object_id\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "In additional to providing a 1-1 correspondence, the identity_map plugin also provides a cached looked up of records in two cases:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Model.[] (e.g. Album[1])
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Model.many_to_one accessor methods (e.g. album.artist)
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: If the object you are looking up using one of those two methods is already in the identity map, the record is returned without a database query being issued.
- !ruby/struct:SM::Flow::P 
  body: Identity maps are thread-local and only presist for the duration of the block, so they should be should only be considered as a possible performance enhancer.
constants: []

full_name: Sequel::Plugins::IdentityMap
includes: []

instance_methods: []

name: IdentityMap
superclass: 
