X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=doc%2Fref-ooddl.xml;h=4a2cffa140b4600703290805f4e6352301b5af1d;hp=de79f21229028207fef7aaf801129de7eac1740f;hb=92cad9a9410b8e481987b90cc4f5edd8cc85e7ce;hpb=730b9c2ed37582c51a1c02fcdaee63686bb80beb diff --git a/doc/ref-ooddl.xml b/doc/ref-ooddl.xml index de79f21..4a2cffa 100644 --- a/doc/ref-ooddl.xml +++ b/doc/ref-ooddl.xml @@ -594,7 +594,11 @@ Defaults to nil, i.e. non-normalized schemas. When true, SQL database tables that map to this class and parent classes are joined on their primary keys to get the full - set of database columns for this class. + set of database columns for this class. This means that + the primary key of the base class will be copied to all + subclasses as we insert so that all parent classes of an + instance will have the same value in their primary key slots + (see tests/ds-nodes.lisp and oodml.lisp) @@ -616,6 +620,7 @@ this class. + Normalized inheritance schemas Specifying that :normalizedp is T @@ -716,7 +721,26 @@ CLSQL> (title test-user) CLSQL> (nick test-user) "test-user" + + Notes from a refactor of this code. + + There are many assumptions that need to be met for normalized classes to work + + * The each of the classes should have its own single key column (of a different name) + that will contain an identical value. EG: node has a node-id, setting which + is a node has a node-id and a setting-id which must be equal. You cannot use + node-id as the primary key on both tables (as I would have expected). The exception + to this seems to be if your class has no slots at all, then you dont need to have a + single key column, because your class is fully represented in the db by its parent(s) + * more than one parent class per normalized class should be considered experimental + and untested (vaya con Dios) + + * There are a few code paths that just dont pay any attention to normalized classes + eg: delete-records-for-instance + + + Examples