</para>
<para>
- &clsql; is based on the CommonSQL package from Xanalys, so the
- documentation that Xanalys makes available online is useful for
+ &clsql; is based on the CommonSQL package from LispWorks Ltd, so the
+ documentation that LispWorks makes available online is useful for
&clsql; as well. It is suggested that developers new to &clsql; read
their documentation as well, as any differences between CommonSQL
- and &clsql; are minor. Xanalys makes the following documents
+ and &clsql; are minor. LispWorks makes the following documents
available:
</para>
<itemizedlist>
<listitem>
<para>
- <ulink url="http://www.lispworks.com/reference/lw43/LWUG/html/lwuser-167.htm">
- <citetitle>Xanalys &lw; User Guide - The &commonsql;
+ <ulink url="http://www.lispworks.com/documentation/lw44/LWUG/html/lwuser-204.htm">
+ <citetitle>&lw; User Guide - The &commonsql;
Package
</citetitle>
</ulink>
<listitem>
<para>
- <ulink url="http://www.lispworks.com/reference/lw43/LWRM/html/lwref-383.htm">
- <citetitle>Xanalys &lw; Reference Manual - The SQL
+ <ulink url="http://www.lispworks.com/documentation/lw44/LWRM/html/lwref-424.htm">
+ <citetitle>&lw; Reference Manual - The SQL
Package</citetitle>
</ulink>
</para>
<listitem>
<para>
- <ulink url="http://www.ravenbrook.com/doc/2002/09/13/common-sql/">
+ <ulink url="http://www.lispworks.com/documentation/sql-tutorial/index.html">
<citetitle>&commonsql; Tutorial by Nick Levine</citetitle>
</ulink>
</para>
<footnote>
<para>
<ulink
- url="http://www.arsdigita.com/books/sql/data-modeling.html">
+ url="http://philip.greenspun.com/sql/data-modeling.html">
<citetitle>Philip Greenspun's "SQL For Web Nerds" - Data
Modeling</citetitle>
</ulink>
<listitem>
<para>
- <symbol>:column-</symbol> - A string which will be used as the
+ <symbol>:db-type</symbol> - A string which will be used as the
type specifier for this slots column definition in the database.
</para></listitem>
<symbol>:base-table</symbol> option specifies what the table name
for the view class will be when it is mapped into the database.
</para>
+
+<para>
+ Another class option is <symbol>:normalisedp</symbol>, which signals
+ &clsql; to use a normalised schema for the mapping from slots to
+ &sql; columns. By default &clsql; includes all the slots of a parent
+ class that map to &sql; columns into the child class. This option
+ tells &clsql; to normalise the schema, so that a join is done on the
+ primary keys of the concerned tables to get a complete column set
+ for the classes. For more information, see <link linkend="def-view-class">
+ <function>def-view-class</function></link>.
+</para>
</sect1>
<sect1 id="csql-rel">
<para>
In an &sql; only application, the <symbol>EMPLOYEE</symbol> and
<symbol>COMPANY</symbol> tables can be queried to determine things
-like, "Who is Vladamir's manager?", "What company does Josef work
+like, "Who is Vladimir's manager?", "What company does Josef work
for?", and "What employees work for Widgets Inc.". This is done by
joining tables with an &sql; query.
</para>
</programlisting>
<para>
-Who is Vladamir's manager?
+Who is Vladimir's manager?
</para>
<programlisting>
SELECT managerid FROM employee
- WHERE employee.first_name = "Vladamir"
+ WHERE employee.first_name = "Vladimir"
AND employee.last_name = "Lenin"
</programlisting>
save those till we get to the many-to-many relation examples.
</para>
+
+ <title>Object Oriented Class Relations</title>
+
+<para>
+&clsql; provides an Object Oriented Data Definition Language, which
+provides a mapping from &sql; tables to CLOS objects. By default class
+inheritance is handled by including all the columns from parent
+classes into the child class. This means your database schema becomes
+very much denormalised. The class option <symbol>:normalisedp</symbol>
+can be used to disable the default behaviour and have &clsql;
+normalise the database schemas of inherited classes.
+</para>
+
+<para>
+See <link linkend="def-view-class"><function>def-view-class</function></link>
+for more information.
+</para>
+
</sect1>
<sect1 id="csql-creat">
(defvar employee1 (make-instance 'employee
:emplid 1
- :first-name "Vladamir"
+ :first-name "Vladimir"
:last-name "Lenin"
:email "lenin@soviet.org"
:companyid 1))