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

foreign attribute in sb-class-slot-definition, appropriate change in...

foreign attribute in sb-class-slot-definition, appropriate change in compute-effective-slot-definition.

darcs-hash:7e83d55e05e0a77533343a4eebe170f807397d0b
parent 430a09e1
......@@ -15,7 +15,8 @@
ignored in all database related operations.")
(not-null :initform nil :initarg :not-null :accessor not-null-p
:documentation "If non-NIL, a NON NULL database
constrained will be introduced.")))
constrained will be introduced.")
(foreign :initform nil :initarg :foreign :accessor foreign-type-p)))
(defmetaclass db-class (standard-class)
......@@ -45,16 +46,18 @@ metaclass set to DB-CLASS."
((class db-class) slot-name direct-slot-definitions)
(let ((slotd (call-next-method)))
(setf (transient-p slotd) (every #'transient-p direct-slot-definitions))
(setf (foreign-type-p slotd) (foreign-type-p (car direct-slot-definitions)))
(setf (not-null-p slotd) (not-null-p (car direct-slot-definitions)))
slotd))
(defgeneric foreign-type-p (slot)
(:documentation "Is SLOT foreign?")
(:method ((slot db-class-slot-definition))
(let ((s-d-t (slot-definition-type slot)))
(if (listp s-d-t)
(error "Slots whose type is defined by a list commencing
with 'OR, 'NOT, or 'AND are not supported by DB-CLASS.")
(typep (find-class s-d-t) 'db-class)))))
;; (defgeneric foreign-type-p (slot)
;; (:documentation "Is SLOT foreign?")
;; (:method ((slot db-class-slot-definition))
;; (let ((s-d-t (slot-definition-type slot)))
;; (if (listp s-d-t)
;; (error "Slots whose type is defined by a list commencing
;; with 'OR, 'NOT, or 'AND are not supported by DB-CLASS.")
;; (typep (find-class s-d-t) 'db-class)))))
(defmethod shared-initialize :after ((class db-class) slots &rest rest)
;; create the right table, or, if a table of the right name exists,
......
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