X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fobjects.lisp;h=f2d82e62e8fd2c7e737d4e43d636832e7d29cba2;hp=0ea28e93c244ab4054404a392a8ca79bac80c916;hb=afe872863374de73b2f2ef767e742a40d7465e4a;hpb=dfc357251d94b2d93ffc79f6d979769066dc8f52 diff --git a/sql/objects.lisp b/sql/objects.lisp index 0ea28e9..f2d82e6 100644 --- a/sql/objects.lisp +++ b/sql/objects.lisp @@ -425,30 +425,12 @@ superclass of the newly-defined View Class." (get-slot-values-from-view instance (list slot-def) (car res))))) -(defmethod database-null-value ((type t)) - (cond - ((subtypep type 'string) nil) - ((subtypep type 'integer) nil) - ((subtypep type 'list) nil) - ((subtypep type 'boolean) nil) - ((eql type t) nil) - ((subtypep type 'symbol) nil) - ((subtypep type 'keyword) nil) - ((subtypep type 'wall-time) nil) - ((subtypep type 'duration) nil) - ((subtypep type 'money) nil) - (t - (error "Unable to handle null for type ~A" type)))) - (defmethod update-slot-with-null ((object standard-db-object) slotname slotdef) (let ((st (slot-type slotdef)) - (allowed (slot-value slotdef 'nulls-ok))) - (if allowed - (setf (slot-value object slotname) nil) - (setf (slot-value object slotname) - (database-null-value st))))) + (void-value (slot-value slotdef 'void-value))) + (setf (slot-value object slotname) void-value))) (defvar +no-slot-value+ '+no-slot-value+)