20.4.3 Object-Oriented Data Manipulation Language (OODML)

The OODML is designed to be powerful and expressive, while remaining familiar to users of the FDML. To achieve this aim, some of the functions and macros in the SQL interface have been overloaded -- particularly the select function and the iteration constructs.

The function select is common across the both the functional and object-oriented SQL interfaces. If its first argument, selections, refers to a View Class by supplying its symbolic name then the select operation becomes object-oriented and it returns a list of instances instead of a list of attributes.

A subsequent equivalent select call will return the same ( eql ) instances. The :refresh argument can be used to ensure that existing instances get updated with any changed data. If such an update requires action by your application, then add methods on the generic function instance-refreshed .

In a View Class select call, the symbol slot-value is a valid SQL operator for use within the :where argument.

To find the View Classes for a particular database, use the function list-classes .

To manipulate data via a View Class, that is to modify the records corresponding to instances of the View Class, using the generic functions update-records-from-instance , and update-record-from-slot .

To delete records corresponding to instances of the View Class, use the generic function delete-instance-records .

To update existing instances of a View Class when data is known to have changed, use the generic functions update-slot-from-record and update-instance-from-records . Examples Iteration Garbage collection of view instances

LispWorks User Guide - 11 Mar 2008