X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Foodml.lisp;h=399519cfa0bef8d9544cf3a9b458e4c90513deb4;hb=310198d3ef6c284265a13df7d306c09642f299a2;hp=ab533770543298a672918288e6b05eb10453fa30;hpb=e7a214b2445830219022acb5911a3f9303d938bd;p=clsql.git diff --git a/sql/oodml.lisp b/sql/oodml.lisp index ab53377..399519c 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -87,14 +87,11 @@ ;; Called by 'get-slot-values-from-view' ;; -(defvar *update-context* nil) - (defmethod update-slot-from-db ((instance standard-db-object) slotdef value) (declare (optimize (speed 3) #+cmu (extensions:inhibit-warnings 3))) (let* ((slot-reader (view-class-slot-db-reader slotdef)) (slot-name (slot-definition-name slotdef)) - (slot-type (specified-type slotdef)) - (*update-context* (cons (type-of instance) slot-name))) + (slot-type (specified-type slotdef))) (cond ((and value (null slot-reader)) (setf (slot-value instance slot-name) (read-sql-value value (delistify slot-type) @@ -418,14 +415,12 @@ (defmethod database-output-sql-as-type ((type (eql 'symbol)) val database db-type) (declare (ignore database db-type)) - (if (keywordp val) - (symbol-name val) - (if val - (concatenate 'string - (package-name (symbol-package val)) - "::" - (symbol-name val)) - ""))) + (if val + (concatenate 'string + (package-name (symbol-package val)) + "::" + (symbol-name val)) + "")) (defmethod database-output-sql-as-type ((type (eql 'keyword)) val database db-type) (declare (ignore database db-type)) @@ -484,8 +479,7 @@ (declare (ignore database db-type)) (when (< 0 (length val)) (unless (string= val (symbol-name-default-case "NIL")) - (intern (symbol-name-default-case val) - (symbol-package *update-context*))))) + (read-from-string val)))) (defmethod read-sql-value (val (type (eql 'integer)) database db-type) (declare (ignore database db-type)) @@ -524,7 +518,7 @@ (read-from-string val))) (number val))) -(defmethod read-sql-value (val (type (eql 'univeral-time)) database db-type) +(defmethod read-sql-value (val (type (eql 'universal-time)) database db-type) (declare (ignore database db-type)) (unless (eq 'NULL val) (etypecase val