Commit 957330ac authored by ryszard.szopa's avatar ryszard.szopa
Browse files

Submarine signals an error when you try to create a DAO providing a non-existant ID.

parent 7a456cae
......@@ -80,6 +80,11 @@ any)."
(:select '*
:from (class-name-of dao)
:where (:= 'id (get-id dao))) :alist)))
(unless query-result
(error (make-condition
:format-control "You tried to create a DAO with a non-existant ID."
:id (get-id dao) :table (class-name-of dao))))
(for slot in (non-transient-slots-of dao))
......@@ -99,6 +99,11 @@ right name in the table, but its type is wrong"))
(type :initarg :type :reader column-type))
(:documentation "Condition signaling a missing column in an existing table."))
(define-condition sql-id-does-not-exist (sql-error)
((id :initarg :id :reader id))
(:documentation "Condition signaling the attempt to initialize a dao
with a non-existant ID."))
(defgeneric database-consistent-with-specification (class)
(:documentation "Return nothing if TABLE in the connected-p database
meets its specification. Otherwise, throw an appropriate error. There
Markdown is supported
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