Commit d31b57f6 authored by ryszard.szopa's avatar ryszard.szopa
Browse files

now you cannot initialize an object of an unfinished class.

parent 022e5da4
......@@ -65,6 +65,11 @@ with the values in the given object and return it."))
:where (:= 'id (get-id dao))))))
(defmethod shared-initialize :before ((dao dao) slot-names &rest initargs &key &allow-other-keys)
(declare (ignore slot-names initargs))
(let ((class (class-of dao)))
(when (member class (db-class-unfinished-classes class))
(error 'unresolved-foreign-key :type (class-name class)))))
(defmethod shared-initialize :after ((dao dao) slot-names &rest initargs &key &allow-other-keys)
"If :ID is provided, set the values of the slots according to the
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment