Next Prev Up Top Contents Index

15.4.2 Object-Oriented Data Definition Language (OODDL)

The OODDL lets you define a mapping between the relational and object-oriented worlds to be defined. Through the mapping a CLOS object can effectively denote a collection of records in a database view, and can contain pointers to other view-based CLOS objects. The CLOS object makes explicit an object implicitly described by the flat relational values.

def-view-class

Macro

def-view-class name superclasses slots &rest class-options

Extends the syntax of defclass to allow special base slots to be mapped onto the attributes of database views (presently single tables). When a select query that names a view-class is submitted, then the corresponding database view is queried, and the slots in the resulting instances are filled with attribute values from the database.

It is also possible to create join slots and virtual (ordinary) slots .

All the special slots are distinguished by a modified set of class and slot options. The special slots and their options are described in more detail under def-view-class in the LispWorks Reference Manual .

create-view-from-class

Function

create-view-from-class class &key database

Creates a view in database based on class which defines the view.

drop-view-from-class

Function

drop-view-from-class class &key database

Drops a view from database based on the class which defines that view.

15.4.2.1 Example view-class definition


LispWorks User Guide - 14 Dec 2001

Next Prev Up Top Contents Index