X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fmetaclasses.lisp;h=331e35a01966221026571780190544bc492431db;hb=6c83b1d3ad63edfc36a5bb5aee451d1eacc0d555;hp=72cbc4fffd3c7df025f84aa311d0511a7e9628bb;hpb=464e630439ff3deb9169452b9ffc22efd9489159;p=clsql.git diff --git a/sql/metaclasses.lisp b/sql/metaclasses.lisp index 72cbc4f..331e35a 100644 --- a/sql/metaclasses.lisp +++ b/sql/metaclasses.lisp @@ -425,7 +425,7 @@ implementations." specified-type)))) (if (and type (not (member :not-null (listify db-constraints)))) `(or null ,type) - type))) + (or type t)))) ;; Compute the slot definition for slots in a view-class. Figures out ;; what kind of database value (if any) is stored there, generates and @@ -453,8 +453,10 @@ implementations." (slot-definition-name obj))) (apply #'call-next-method obj 'specified-type type - :type (compute-lisp-type-from-specified-type - type db-constraints) + :type (if (and (eql db-kind :virtual) (null type)) + t + (compute-lisp-type-from-specified-type + type db-constraints)) initargs)) (defmethod compute-effective-slot-definition ((class standard-db-class) @@ -524,6 +526,11 @@ implementations." (setf (specified-type esd) (delistify-dsd (specified-type dsd))) + ;; The type-check-function is computed at defclass expansion, + ;; which is too early for the CLSQL type conversion to take + ;; place. This gets rid of it. It's ugly but it's better + ;; than nothing -wcp10/4/10. + #+sbcl (setf (slot-value esd 'sb-pcl::%type-check-function) nil) ) ;; all other slots