indexing
     description: "Objects that redefine ACTION to store Eiffel objects converted  from database in a list."
     author: "pascalf"
     date: "$Date$"
     revision: "$Revision$"
     product: eiffelstore
     database: all_bases

class interface
     DB_ACTION [G]

create

     make (a_selection: like selection; an_item: G)
                 -- Initialize.
           require
                 not_void: a_selection /= void and an_item /= void
           ensure
                 set: selection = a_selection and item = an_item

feature -- Access

     item: G
                 -- Current found item in selection.
                 -- Must be a reference on selection.object,
                 -- thus selection.cursor_to_object updates it.

     list: ARRAYED_LIST [G]
                 -- Result list.

     selection: DB_SELECTION
                 -- Current selection.
     
feature -- Basic operations

     found: BOOLEAN
                 -- Is there any exit condition found
                 -- while iterating on selection results in
                 -- load_result of DB_SELECTION?
                 -- (Default: do nothing)
                 -- (from ACTION)

     start
                 -- Execute something whenever
                 -- routine load_result of DB_SELECTION is
                 -- called with Current set as stop_condition,
                 -- before iterating on query result.
                 -- (Default: do nothing)
                 -- (from ACTION)
     
feature -- Actions

     execute
                 -- Update item with current
                 -- selected item in the container.
     
feature -- Creation

     make (a_selection: like selection; an_item: G)
                 -- Initialize.
           require
                 not_void: a_selection /= void and an_item /= void
           ensure
                 set: selection = a_selection and item = an_item
     
invariant

           -- from ANY
     reflexive_equality: standard_is_equal (Current)
     reflexive_conformance: conforms_to (Current)

end -- class DB_ACTION