r9678: 23 Jun 2004 Kevin Rosenberg <kevin@rosenberg.net>
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 24 Jun 2004 08:00:53 +0000 (08:00 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 24 Jun 2004 08:00:53 +0000 (08:00 +0000)
        * sql/oodml.lisp: Add keyword :transactions to def-view-from-class
        to allow specifying transactionless table creation
        * doc/ref-oodml.lisp: Add new keyword to signature of
        DEF-VIEW-FROM-CLASS

ChangeLog
doc/ref-ooddl.xml
sql/generics.lisp
sql/ooddl.lisp

index efb0ac7f8bddd7d73174c6df6bd38a5917603c6d..ff355b2720c0357dc7011b245090639a3b551492 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+23 Jun 2004 Kevin Rosenberg <kevin@rosenberg.net>
+       * sql/oodml.lisp: Add keyword :transactions to def-view-from-class
+       to allow specifying transactionless table creation
+       * doc/ref-oodml.lisp: Add new keyword to signature of 
+       DEF-VIEW-FROM-CLASS     
+       
 18 Jun 2004 Marcus Pearce <m.t.pearce@city.ac.uk> 
        * Version 2.11.11
        * sql/expressions.lisp: when removing duplicate table identifiers 
index 568cb1af80d0eb0c0bcf9cf1431e19b735cc5586..ebe7de14b369f8d5b4ed360773f9f5b41a717023 100644 (file)
@@ -97,7 +97,7 @@
     <refsect1>
       <title>Syntax</title>
       <synopsis>
-      <function> (CREATE-VIEW-FROM-CLASS VIEW-CLASS-NAME &amp;KEY (DATABASE *DEFAULT-DATABASE*)) [function]</function> => <returnvalue><!-- result --></returnvalue></synopsis>
+      <function> (CREATE-VIEW-FROM-CLASS VIEW-CLASS-NAME &amp;KEY (DATABASE *DEFAULT-DATABASE*) (TRANSACTIONS T)) [function]</function> => <returnvalue><!-- result --></returnvalue></synopsis>
     </refsect1>
     <refsect1>
       <title>Arguments and Values</title>
index 9ff64921b2413c39709815539e2328708aaad5b5..5bc74ca9e2514240a5b1f67cb5210178f4f426bc 100644 (file)
@@ -139,7 +139,7 @@ DATABASE-NULL-VALUE on the type of the slot."))
   )
 (defgeneric database-constraint-statement  (constraints database)
   )
-(defgeneric %install-class  (class database)
+(defgeneric %install-class  (class database &key transactions)
   )
 (defgeneric database-generate-column-definition  (class slotdef database)
   )
index c5e9d885b941d07a9d203313bdd1a2de30c6c794..64d974a99f758a91b487ff48a676b770475b979e 100644 (file)
 ;;
 
 (defun create-view-from-class (view-class-name
-                               &key (database *default-database*))
+                               &key (database *default-database*)
+                              (transactions t))
   "Creates a table as defined by the View Class VIEW-CLASS-NAME
 in DATABASE which defaults to *DEFAULT-DATABASE*."
   (let ((tclass (find-class view-class-name)))
     (if tclass
         (let ((*default-database* database))
-          (%install-class tclass database))
+          (%install-class tclass database :transactions transactions))
         (error "Class ~s not found." view-class-name)))
   (values))
 
-(defmethod %install-class ((self standard-db-class) database &aux schemadef)
-  (dolist (slotdef (ordered-class-slots self))
-    (let ((res (database-generate-column-definition (class-name self)
-                                                    slotdef database)))
-      (when res 
-        (push res schemadef))))
-  (unless schemadef
-    (error "Class ~s has no :base slots" self))
-  (create-table (sql-expression :table (view-table self)) (nreverse schemadef)
-                :database database
-                :constraints (database-pkey-constraint self database))
-  (push self (database-view-classes database))
+(defmethod %install-class ((self standard-db-class) database
+                          &key (transactions t))
+  (let ((schemadef '()))
+    (dolist (slotdef (ordered-class-slots self))
+      (let ((res (database-generate-column-definition (class-name self)
+                                                     slotdef database)))
+       (when res 
+         (push res schemadef))))
+    (unless schemadef
+      (error "Class ~s has no :base slots" self))
+    (create-table (sql-expression :table (view-table self)) (nreverse schemadef)
+                 :database database
+                 :transactions transactions
+                 :constraints (database-pkey-constraint self database))
+    (push self (database-view-classes database)))
   t)
 
 (defmethod database-pkey-constraint ((class standard-db-class) database)