Lookup of a single object based on the value of one or more data members
ObjectStore supports associative access to persistent objects. We illustrate the use of
this mechanism using the SalesStaff extent and, as a first example, we retrieve one
element of this extent using the query_pick method, which takes three parameters:
– a string indicating the element type of the collection being queried (in this case
SalesStaff*);
– a string indicating the condition that elements must satisfy in order to be selected by
the query (in this case the element where the staffNo data member is SG37);
– a pointer to the database containing the collection being queried (in this case db1).