r9678: 23 Jun 2004 Kevin Rosenberg <kevin@rosenberg.net>
[clsql.git] / doc / ref-ooddl.xml
1 <?xml version='1.0' ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % myents SYSTEM "entities.inc">
5 %myents;
6 ]>
7
8 <!-- Object Oriented Data Definition Language --> 
9 <reference id="ref-ooddl"> 
10   <title>Object Oriented Data Definition Language (OODDL)</title> 
11     <partintro>
12     <para>
13       <!-- introduction --> 
14     </para>
15   </partintro>
16
17   <refentry id="standard-db-object">
18     <refnamediv>
19       <refname>STANDARD-DB-OBJECT</refname>
20       <refpurpose>Superclass for all &clsql; View Classes.</refpurpose>
21       <refclass>Class</refclass>
22     </refnamediv>
23     <refsect1>
24       <title>Class Precedence List</title>
25       <para>
26         <simplelist type="inline">
27           <member><type>standard-db-object</type></member>
28           <member><type>standard-object</type></member>
29           <member><type>t</type></member>
30         </simplelist>
31       </para>
32     </refsect1>
33     <refsect1>
34       <title>Description</title> <para>This class is the superclass
35       of all &clsql; View Classes.</para>
36     </refsect1>
37     <refsect1>
38       <title class="contenttitle">Class details</title>
39       <programlisting>(defclass STANDARD-DB-OBJECT ()(...))</programlisting>
40     </refsect1>
41     <refsect1>
42       <title class="contenttitle">Slots</title>
43       <para>
44         <simplelist> 
45           <property>slot VIEW-DATABASE is of type T</property>
46         </simplelist> 
47       </para>
48     </refsect1>
49   </refentry>
50
51   <refentry id="default-varchar-length">
52     <refnamediv>
53       <refname>*DEFAULT-VARCHAR-LENGTH*</refname>
54       <refpurpose><!-- purpose --></refpurpose>
55       <refclass>Variable</refclass>
56     </refnamediv>
57     <refsect1>
58       <title>Value Type</title>
59       <para>
60         <!-- value type --> 
61       </para> 
62     </refsect1>
63     <refsect1>
64       <title>Initial Value</title>
65       <para><symbol>nil</symbol></para>
66     </refsect1>
67     <refsect1>
68       <title>Description</title>
69       <!-- description --> 
70     </refsect1>
71     <refsect1>
72       <title>Examples</title>
73       <screen>
74         <!-- examples --> 
75       </screen>
76     </refsect1>
77     <refsect1>
78       <title>Affected By</title>
79       <para>None.</para>
80     </refsect1>
81     <refsect1>
82       <title>See Also</title>
83       <para>None.</para>
84     </refsect1>
85     <refsect1>
86       <title>Notes</title>
87       <para>None.</para>
88     </refsect1>
89   </refentry>
90
91   <refentry id="create-view-from-class">
92     <refnamediv>
93       <refname>CREATE-VIEW-FROM-CLASS</refname>
94       <refpurpose><!-- purpose --></refpurpose>
95       <refclass>Function</refclass>
96     </refnamediv>
97     <refsect1>
98       <title>Syntax</title>
99       <synopsis>
100       <function> (CREATE-VIEW-FROM-CLASS VIEW-CLASS-NAME &amp;KEY (DATABASE *DEFAULT-DATABASE*) (TRANSACTIONS T)) [function]</function> => <returnvalue><!-- result --></returnvalue></synopsis>
101     </refsect1>
102     <refsect1>
103       <title>Arguments and Values</title>
104       <variablelist>
105         <!-- arguments and values --> 
106       </variablelist>
107     </refsect1>
108     <refsect1>
109       <title>Description</title>
110       <para>Creates a table as defined by the View Class
111       VIEW-CLASS-NAME in DATABASE which defaults to
112       *DEFAULT-DATABASE*.
113       </para>
114     </refsect1>
115     <refsect1>
116       <title>Examples</title>
117       <screen>
118         <!-- examples -->
119       </screen>
120     </refsect1>
121     <refsect1>
122       <title>Side Effects</title>
123       <para>
124         <!-- side effects --> 
125       </para>
126     </refsect1>
127     <refsect1>
128       <title>Affected by</title>
129       <para>
130         <simplelist>
131           <!-- affected by --> 
132         </simplelist>
133       </para>
134     </refsect1>
135     <refsect1>
136       <title>Exceptional Situations</title>
137       <para>
138         <!-- execeptional situations -->
139       </para>
140     </refsect1>
141     <refsect1>
142       <title>See Also</title>
143       <para>
144         <simplelist>
145           <!-- see also --> 
146         </simplelist>
147       </para>
148     </refsect1>
149     <refsect1>
150       <title>Notes</title>
151       <para>
152         <!-- notes --> 
153       </para>
154     </refsect1>
155   </refentry>
156
157   <refentry id="def-view-class">
158     <refnamediv>
159       <refname>DEF-VIEW-CLASS</refname>
160       <refpurpose><!-- purpose --></refpurpose>
161       <refclass>Function</refclass>
162     </refnamediv>
163     <refsect1>
164       <title>Syntax</title>
165       <synopsis>
166       <function> (DEF-VIEW-CLASS CLASS SUPERS SLOTS &amp;REST CL-OPTIONS) [macro]</function> => <returnvalue><!-- result --></returnvalue></synopsis>
167     </refsect1>
168     <refsect1>
169       <title>Arguments and Values</title>
170       <variablelist>
171         <!-- arguments and values --> 
172       </variablelist>
173     </refsect1>
174     <refsect1>
175       <title>Description</title>
176       <para>Creates a View Class called CLASS whose slots SLOTS can
177       map onto the attributes of a table in a database. If SUPERS is
178       nil then the superclass of CLASS will be STANDARD-DB-OBJECT,
179       otherwise SUPERS is a list of superclasses for CLASS which
180       must include STANDARD-DB-OBJECT or a descendent of this
181       class. The syntax of DEFCLASS is extended through the addition
182       of a class option :base-table which defines the database table
183       onto which the View Class maps and which defaults to
184       CLASS. The DEFCLASS syntax is also extended through additional
185       slot options. The :db-kind slot option specifies the kind of
186       DB mapping which is performed for this slot and defaults to
187       :base which indicates that the slot maps to an ordinary column
188       of the database table. A :db-kind value of :key indicates that
189       this slot is a special kind of :base slot which maps onto a
190       column which is one of the unique keys for the database table,
191       the value :join indicates this slot represents a join onto
192       another View Class which contains View Class objects, and the
193       value :virtual indicates a standard CLOS slot which does not
194       map onto columns of the database table. If a slot is specified
195       with :db-kind :join, the slot option :db-info contains a list
196       which specifies the nature of the join. For slots of :db-kind
197       :base or :key, the :type slot option has a special
198       interpretation such that Lisp types, such as string, integer
199       and float are automatically converted into appropriate SQL
200       types for the column onto which the slot maps. This behaviour
201       may be over-ridden using the :db-type slot option which is a
202       string specifying the vendor-specific database type for this
203       slot's column definition in the database. The :column slot
204       option specifies the name of the SQL column which the slot
205       maps onto, if :db-kind is not :virtual, and defaults to the
206       slot name. The :void-value slot option specifies the value to
207       store if the SQL value is NULL and defaults to NIL. The
208       :db-constraints slot option is a string representing an SQL
209       table constraint expression or a list of such strings.
210       </para>
211     </refsect1>
212     <refsect1>
213       <title>Examples</title>
214       <screen>
215         <!-- examples -->
216       </screen>
217     </refsect1>
218     <refsect1>
219       <title>Side Effects</title>
220       <para>
221         <!-- side effects --> 
222       </para>
223     </refsect1>
224     <refsect1>
225       <title>Affected by</title>
226       <para>
227         <simplelist>
228           <!-- affected by --> 
229         </simplelist>
230       </para>
231     </refsect1>
232     <refsect1>
233       <title>Exceptional Situations</title>
234       <para>
235         <!-- execeptional situations -->
236       </para>
237     </refsect1>
238     <refsect1>
239       <title>See Also</title>
240       <para>
241         <simplelist>
242           <!-- see also --> 
243         </simplelist>
244       </para>
245     </refsect1>
246     <refsect1>
247       <title>Notes</title>
248       <para>
249         <!-- notes --> 
250       </para>
251     </refsect1>
252   </refentry>
253
254   <refentry id="drop-view-from-class">
255     <refnamediv>
256       <refname>DROP-VIEW-FROM-CLASS</refname>
257       <refpurpose><!-- purpose --></refpurpose>
258       <refclass>Function</refclass>
259     </refnamediv>
260     <refsect1>
261       <title>Syntax</title>
262       <synopsis>
263       <function> (DROP-VIEW-FROM-CLASS VIEW-CLASS-NAME &amp;KEY (DATABASE *DEFAULT-DATABASE*)) [function]</function> => <returnvalue><!-- result --></returnvalue></synopsis>
264     </refsect1>
265     <refsect1>
266       <title>Arguments and Values</title>
267       <variablelist>
268         <!-- arguments and values --> 
269       </variablelist>
270     </refsect1>
271     <refsect1>
272       <title>Description</title>
273       <para>Removes a table defined by the View Class
274       VIEW-CLASS-NAME from DATABASE which defaults to
275       *DEFAULT-DATABASE*.
276       </para>
277     </refsect1>
278     <refsect1>
279       <title>Examples</title>
280       <screen>
281         <!-- examples -->
282       </screen>
283     </refsect1>
284     <refsect1>
285       <title>Side Effects</title>
286       <para>
287         <!-- side effects --> 
288       </para>
289     </refsect1>
290     <refsect1>
291       <title>Affected by</title>
292       <para>
293         <simplelist>
294           <!-- affected by --> 
295         </simplelist>
296       </para>
297     </refsect1>
298     <refsect1>
299       <title>Exceptional Situations</title>
300       <para>
301         <!-- execeptional situations -->
302       </para>
303     </refsect1>
304     <refsect1>
305       <title>See Also</title>
306       <para>
307         <simplelist>
308           <!-- see also --> 
309         </simplelist>
310       </para>
311     </refsect1>
312     <refsect1>
313       <title>Notes</title>
314       <para>
315         <!-- notes --> 
316       </para>
317     </refsect1>
318   </refentry>
319
320   <refentry id="list-classes">
321     <refnamediv>
322       <refname>LIST-CLASSES</refname>
323       <refpurpose><!-- purpose --></refpurpose>
324       <refclass>Function</refclass>
325     </refnamediv>
326     <refsect1>
327       <title>Syntax</title>
328       <synopsis>
329       <function> (LIST-CLASSES &amp;KEY (TEST #'IDENTITY) (ROOT-CLASS (FIND-CLASS 'STANDARD-DB-OBJECT)) (DATABASE *DEFAULT-DATABASE*)) [function]</function> => <returnvalue><!-- result --></returnvalue></synopsis>
330     </refsect1>
331     <refsect1>
332       <title>Arguments and Values</title>
333       <variablelist>
334         <!-- arguments and values --> 
335       </variablelist>
336     </refsect1>
337     <refsect1>
338       <title>Description</title>
339       <para>Returns a list of all the View Classes which
340       are connected to DATABASE, which defaults to
341       *DEFAULT-DATABASE*, and which descend from the class
342       ROOT-CLASS and which satisfy the function TEST. By
343       default ROOT-CLASS is STANDARD-DB-OBJECT and TEST is
344       IDENTITY.
345       </para>
346     </refsect1>
347     <refsect1>
348       <title>Examples</title>
349       <screen>
350         <!-- examples -->
351       </screen>
352     </refsect1>
353     <refsect1>
354       <title>Side Effects</title>
355       <para>
356         <!-- side effects --> 
357       </para>
358     </refsect1>
359     <refsect1>
360       <title>Affected by</title>
361       <para>
362         <simplelist>
363           <!-- affected by --> 
364         </simplelist>
365       </para>
366     </refsect1>
367     <refsect1>
368       <title>Exceptional Situations</title>
369       <para>
370         <!-- execeptional situations -->
371       </para>
372     </refsect1>
373     <refsect1>
374       <title>See Also</title>
375       <para>
376         <simplelist>
377           <!-- see also --> 
378         </simplelist>
379       </para>
380     </refsect1>
381     <refsect1>
382       <title>Notes</title>
383       <para>
384         <!-- notes --> 
385       </para>
386     </refsect1>
387   </refentry>
388
389
390
391
392 </reference>