From: Kevin Rosenberg Date: Fri, 29 Jan 2010 01:14:30 +0000 (-0700) Subject: Change from British normalised spelling X-Git-Tag: v4.3.2~1 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=730b9c2ed37582c51a1c02fcdaee63686bb80beb Change from British normalised spelling Signed-off-by: Kevin Rosenberg --- diff --git a/ChangeLog b/ChangeLog index a95eab2..f750a70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +28 Jan 2009 Kevin Rosenberg + * Change "normalise" from British spelling for consistency with + other American spellings in CLSQL. + 28 Jan 2009 Kevin Rosenberg * db-mysql/Makefile: Add directory for Fedora 11/12 on 64-bit platform (Thanks to Michael Pheasant) and remove a 32-bit directory diff --git a/doc/clsql.pdf b/doc/clsql.pdf index 6d5f45a..2eccf6f 100644 Binary files a/doc/clsql.pdf and b/doc/clsql.pdf differ diff --git a/doc/csql.xml b/doc/csql.xml index 4374d93..4787898 100644 --- a/doc/csql.xml +++ b/doc/csql.xml @@ -294,11 +294,11 @@ mapped into a database). They would be defined as follows: - Another class option is :normalisedp, which signals - &clsql; to use a normalised schema for the mapping from slots to + Another class option is :normalizedp, which signals + &clsql; to use a normalized 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 + tells &clsql; to normalize 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 def-view-class. @@ -473,9 +473,9 @@ save those till we get to the many-to-many relation examples. 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 :normalisedp +very much denormalized. The class option :normalizedp can be used to disable the default behaviour and have &clsql; -normalise the database schemas of inherited classes. +normalize the database schemas of inherited classes. diff --git a/doc/html.tar.gz b/doc/html.tar.gz index b383815..bce44bf 100644 Binary files a/doc/html.tar.gz and b/doc/html.tar.gz differ diff --git a/doc/ref-ooddl.xml b/doc/ref-ooddl.xml index be98f6d..de79f21 100644 --- a/doc/ref-ooddl.xml +++ b/doc/ref-ooddl.xml @@ -589,9 +589,9 @@ - :normalisedp - specifies whether - this class uses normalised inheritance from parent classes. - Defaults to nil, i.e. non-normalised schemas. When true, + :normalizedp - specifies whether + this class uses normalized inheritance from parent classes. + 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. @@ -616,15 +616,15 @@ this class. - Normalised inheritance schemas + Normalized inheritance schemas - Specifying that :normalisedp is T - tells &clsql; to normalise the database schema for inheritance. + Specifying that :normalizedp is T + tells &clsql; to normalize the database schema for inheritance. What this means is shown in the examples below. - With :normalisedp equal to NIL + With :normalizedp equal to NIL (the default) the class inheritance would result in the following: @@ -654,7 +654,7 @@ SQL table USER: - Using :normalisedp T, both + Using :normalizedp T, both view-classes need a primary key to join them on: @@ -676,7 +676,7 @@ SQL table NODE: ((user-id :accessor user-id :initarg :user-id :type integer :db-kind :key :db-constraints (:not-null)) (nick :accessor nick :initarg :nick :type (varchar 64))) - (:normalisedp t)) + (:normalizedp t)) SQL table USER: +---------+-------------+------+-----+---------+-------+ @@ -690,7 +690,7 @@ SQL table USER: In this second case, all slots of the view-class 'node are also available in view-class 'user, and can be used - as one would expect. For example, with the above normalised + as one would expect. For example, with the above normalized view-classes 'node and 'user, and SQL tracing turned on: diff --git a/sql/metaclasses.lisp b/sql/metaclasses.lisp index 0d6471b..72a3388 100644 --- a/sql/metaclasses.lisp +++ b/sql/metaclasses.lisp @@ -46,8 +46,8 @@ (key-slots :accessor key-slots :initform nil) - (normalisedp - :accessor normalisedp + (normalizedp + :accessor normalizedp :initform nil) (class-qualifier :accessor view-class-qualifier @@ -125,7 +125,7 @@ (defmethod initialize-instance :around ((class standard-db-class) &rest all-keys &key direct-superclasses base-table - qualifier normalisedp + qualifier normalizedp &allow-other-keys) (let ((root-class (find-class 'standard-db-object nil)) (vmc 'standard-db-class)) @@ -142,19 +142,19 @@ (remove-keyword-arg all-keys :direct-superclasses))) (call-next-method)) (set-view-table-slot class base-table) - (setf (normalisedp class) (car normalisedp)) + (setf (normalizedp class) (car normalizedp)) (register-metaclass class (nth (1+ (position :direct-slots all-keys)) all-keys)))) (defmethod reinitialize-instance :around ((class standard-db-class) &rest all-keys - &key base-table normalisedp + &key base-table normalizedp direct-superclasses qualifier &allow-other-keys) (let ((root-class (find-class 'standard-db-object nil)) (vmc 'standard-db-class)) (set-view-table-slot class base-table) - (setf (normalisedp class) (car normalisedp)) + (setf (normalizedp class) (car normalizedp)) (setf (view-class-qualifier class) (car qualifier)) (if (and root-class (not (equal class root-class))) @@ -209,7 +209,7 @@ (setf (key-slots class) (remove-if-not (lambda (slot) (eql (slot-value slot 'db-kind) :key)) - (if (normalisedp class) + (if (normalizedp class) (ordered-class-direct-slots class) (ordered-class-slots class)))))) @@ -218,7 +218,7 @@ (setf (key-slots class) (remove-if-not (lambda (slot) (eql (slot-value slot 'db-kind) :key)) - (if (normalisedp class) + (if (normalizedp class) (ordered-class-direct-slots class) (ordered-class-slots class))))) diff --git a/sql/ooddl.lisp b/sql/ooddl.lisp index 2a81f8a..ddc1452 100644 --- a/sql/ooddl.lisp +++ b/sql/ooddl.lisp @@ -45,7 +45,7 @@ (setf (slot-value instance slot-name) (fault-join-slot class instance slot-object)) (setf (slot-value instance slot-name) nil))) - (when (and (normalisedp class) + (when (and (normalizedp class) (not (member slot-name (mapcar #'(lambda (esd) (slot-definition-name esd)) (ordered-class-direct-slots class)))) @@ -53,7 +53,7 @@ (let ((*db-deserializing* t)) (if (view-database instance) (setf (slot-value instance slot-name) - (fault-join-normalised-slot class instance slot-object)) + (fault-join-normalized-slot class instance slot-object)) (setf (slot-value instance slot-name) nil))))))) (call-next-method)) @@ -93,7 +93,7 @@ in DATABASE which defaults to *DEFAULT-DATABASE*." (if tclass (let ((*default-database* database) (pclass (car (class-direct-superclasses tclass)))) - (when (and (normalisedp tclass) (not (table-exists-p (view-table pclass)))) + (when (and (normalizedp tclass) (not (table-exists-p (view-table pclass)))) (create-view-from-class (class-name pclass) :database database :transactions transactions)) (%install-class tclass database :transactions transactions)) @@ -104,7 +104,7 @@ in DATABASE which defaults to *DEFAULT-DATABASE*." (defmethod %install-class ((self standard-db-class) database &key (transactions t)) (let ((schemadef '()) - (ordered-slots (if (normalisedp self) + (ordered-slots (if (normalizedp self) (ordered-class-direct-slots self) (ordered-class-slots self)))) (dolist (slotdef ordered-slots) @@ -113,7 +113,7 @@ in DATABASE which defaults to *DEFAULT-DATABASE*." (when res (push res schemadef)))) (if (not schemadef) - (unless (normalisedp self) + (unless (normalizedp self) (error "Class ~s has no :base slots" self)) (progn (create-table (sql-expression :table (view-table self)) (nreverse schemadef) diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 9910ab4..e075b0c 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -55,7 +55,7 @@ (defun generate-selection-list (vclass) (let* ((sels nil) (this-class vclass) - (slots (if (normalisedp vclass) + (slots (if (normalizedp vclass) (labels ((getdslots () (let ((sl (ordered-class-direct-slots this-class))) (cond (sl) @@ -174,8 +174,8 @@ (database *default-database*)) (let* ((database (or (view-database obj) database)) (view-class (class-of obj))) - (when (normalisedp view-class) - ;; If it's normalised, find the class that actually contains + (when (normalizedp view-class) + ;; If it's normalized, find the class that actually contains ;; the slot that's tied to the db (setf view-class (do ((this-class view-class @@ -250,20 +250,20 @@ (pk-slot (car (keyslots-for-class view-class))) (view-class-table (view-table view-class)) (pclass (car (class-direct-superclasses view-class)))) - (when (normalisedp view-class) + (when (normalizedp view-class) (setf pk (update-records-from-instance obj :database database :this-class pclass)) (when pk-slot (setf (slot-value obj (slot-definition-name pk-slot)) pk))) (let* ((slots (remove-if-not #'slot-storedp - (if (normalisedp view-class) + (if (normalizedp view-class) (ordered-class-direct-slots view-class) (ordered-class-slots view-class)))) (record-values (mapcar #'slot-value-list slots))) - (cond ((and (not (normalisedp view-class)) + (cond ((and (not (normalizedp view-class)) (not record-values)) (error "No settable slots.")) - ((and (normalisedp view-class) + ((and (normalizedp view-class) (not record-values)) nil) ((view-database obj) @@ -311,7 +311,7 @@ (let* ((view-class (or this-class (class-of instance))) (pclass (car (class-direct-superclasses view-class))) (pres nil)) - (when (normalisedp view-class) + (when (normalizedp view-class) (setf pres (update-instance-from-records instance :database database :this-class pclass))) (let* ((view-table (sql-expression :table (view-table view-class))) @@ -335,8 +335,8 @@ slot &key (database *default-database*)) (let* ((view-class (find-class (class-name (class-of instance)))) (slot-def (slotdef-for-slot-with-class slot view-class))) - (when (normalisedp view-class) - ;; If it's normalised, find the class that actually contains + (when (normalizedp view-class) + ;; If it's normalized, find the class that actually contains ;; the slot that's tied to the db (setf view-class (do ((this-class view-class @@ -875,7 +875,7 @@ maximum of MAX-LEN instances updated in each query." ;;;; Should we not return the whole result, instead of only ;;;; the one slot-value? We get all the values from the db ;;;; anyway, so? -(defun fault-join-normalised-slot (class object slot-def) +(defun fault-join-normalized-slot (class object slot-def) (labels ((getsc (this-class) (let ((sc (car (class-direct-superclasses this-class)))) (if (key-slots sc) @@ -898,7 +898,7 @@ maximum of MAX-LEN instances updated in each query." (slot-value object hk)) (t hk))))) - ;; Caching nil in next select, because in normalised mode + ;; Caching nil in next select, because in normalized mode ;; records can be changed through other instances (children, ;; parents) so changes possibly won't be noticed (let ((res (car (select (class-name sc) :where jq @@ -907,14 +907,14 @@ maximum of MAX-LEN instances updated in each query." :database (view-database object)))) (slot-name (slot-definition-name slot-def))) - ;; If current class is normalised and wanted slot is not + ;; If current class is normalized and wanted slot is not ;; a direct member, recurse up - (if (and (normalisedp class) + (if (and (normalizedp class) (not (member slot-name (mapcar #'(lambda (esd) (slot-definition-name esd)) (ordered-class-direct-slots class)))) (not (slot-boundp res slot-name))) - (fault-join-normalised-slot sc res slot-def) + (fault-join-normalized-slot sc res slot-def) (slot-value res slot-name)))))) ) (defun join-qualifier (class object slot-def) @@ -979,7 +979,7 @@ maximum of MAX-LEN instances updated in each query." ;; find all immediate-select slots and join-vals for this object (let* ((jo-class (class-of jo)) (slots - (if (normalisedp jo-class) + (if (normalizedp jo-class) (class-direct-slots jo-class) (class-slots jo-class))) (pos-list (remove-if #'null diff --git a/tests/ds-nodes.lisp b/tests/ds-nodes.lisp index 7a8c8a6..bb43ff0 100644 --- a/tests/ds-nodes.lisp +++ b/tests/ds-nodes.lisp @@ -19,7 +19,7 @@ -;; classes for testing the normalisedp stuff +;; classes for testing the normalizedp stuff (def-view-class node () ((node-id :accessor node-id :initarg :node-id :type integer :db-kind :key @@ -34,31 +34,31 @@ ((setting-id :accessor setting-id :initarg :setting-id :type integer :db-kind :key :db-constraints (:not-null)) (vars :accessor vars :initarg :vars :type (varchar 240))) - (:normalisedp t)) + (:normalizedp t)) (def-view-class user (node) ((user-id :accessor user-id :initarg :user-id :type integer :db-kind :key :db-constraints (:not-null)) (nick :accessor nick :initarg :nick :type (varchar 64))) - (:normalisedp t)) + (:normalizedp t)) (def-view-class theme (setting) ((theme-id :accessor theme-id :initarg :theme-id :type integer :db-kind :key :db-constraints (:not-null)) (doc :accessor doc :initarg :doc :type (varchar 240))) - (:normalisedp t)) + (:normalizedp t)) ;; A class that uses only a superclass db table (def-view-class location (node) () (:base-table node) - (:normalisedp t)) + (:normalizedp t)) (def-view-class subloc (location) ((subloc-id :accessor subloc-id :initarg :subloc-id :type integer :db-kind :key :db-constraints (:not-null)) (loc :accessor loc :initarg :loc :type (varchar 64))) - (:normalisedp t)) + (:normalizedp t)) diff --git a/tests/test-ooddl.lisp b/tests/test-ooddl.lisp index 24a9750..fb4e143 100644 --- a/tests/test-ooddl.lisp +++ b/tests/test-ooddl.lisp @@ -71,20 +71,20 @@ (clsql-sys::class-slots (find-class 'company)))) t t t t t t) -;; Ensure classes are correctly marked normalised or not, default not +;; Ensure classes are correctly marked normalized or not, default not ;(deftest :ooddl/metaclass/3 ; (values -; (clsql-sys::normalisedp derivednode1) -; (clsql-sys::normalisedp basenode) -; (clsql-sys::normalisedp company1) -; (clsql-sys::normalisedp employee3) -; (clsql-sys::normalisedp derivednode-sc-2)) +; (clsql-sys::normalizedp derivednode1) +; (clsql-sys::normalizedp basenode) +; (clsql-sys::normalizedp company1) +; (clsql-sys::normalizedp employee3) +; (clsql-sys::normalizedp derivednode-sc-2)) ; t nil nil nil t) ;(deftest :ooddl/metaclass/3 ; (values -; (normalisedp (find-class 'baseclass)) -; (normalisedp (find-class 'normderivedclass))) +; (normalizedp (find-class 'baseclass)) +; (normalizedp (find-class 'normderivedclass))) ; nil t) (deftest :ooddl/join/1 diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index ca1b7f8..06e2460 100644 --- a/tests/test-oodml.lisp +++ b/tests/test-oodml.lisp @@ -630,7 +630,7 @@ (slot-value employee1 'email)))) "lenin@soviet.org" "lenin-nospam@soviet.org") -;; tests normalisedp update-instance-from-records +;; tests normalizedp update-instance-from-records (deftest :oodml/update-instance/3 (with-dataset *ds-nodes* (values @@ -697,7 +697,7 @@ "11 subloc-2 second subloc" "11 Altered title Altered loc") -;; tests update-slot-from-record with normalisedp stuff +;; tests update-slot-from-record with normalizedp stuff (deftest :oodml/update-instance/6 (with-dataset *ds-nodes* (values