r10516: 06 May 2005 Kevin Rosenberg <kevin@rosenberg.net>
[clsql.git] / sql / oodml.lisp
index 4644bf1c1589fdb351bb5ea1833f688d68c7daa1..2e0f6a64182237f0cadc43eccb323e29922fbaf8 100644 (file)
           ((typep slot-reader 'string)
            (setf (slot-value instance slot-name)
                  (format nil slot-reader value)))
-          ((typep slot-reader 'function)
+          ((typep slot-reader '(or symbol function))
            (setf (slot-value instance slot-name)
                  (apply slot-reader (list value))))
           (t
        (dbtype (specified-type slotdef)))
     (typecase dbwriter
       (string (format nil dbwriter val))
-      (function (apply dbwriter (list val)))
+      ((or symbol function) (apply dbwriter (list val)))
       (t
        (database-output-sql-as-type
        (typecase dbtype
          (sels (generate-selection-list view-class))
          (res (apply #'select (append (mapcar #'cdr sels)
                                       (list :from  view-table
-                                            :where view-qual)
-                                     (list :result-types nil)))))
+                                            :where view-qual
+                                           :result-types nil
+                                           :database vd)))))
     (when res
       (get-slot-values-from-view instance (mapcar #'car sels) (car res)))))