;; ------------------------------------------------------------
;; metaclass: view-class
-(defclass standard-db-class (standard-class)
+(defclass view-metaclass (standard-class)
((view-table
:accessor view-table
:initarg :view-table)
#+lispworks
(defmethod clos::canonicalize-defclass-slot :around
- ((prototype standard-db-class) slot)
+ ((prototype view-metaclass) slot)
"\\lw\\ signals an error on unknown slot options; so this method
removes any extra allowed options before calling the default method
and returns the canonicalized extra options concatenated to the result
#+lispworks
(defmethod clos::canonicalize-class-options :around
- ((prototype standard-db-class) class-options)
+ ((prototype view-metaclass) class-options)
"\\lw\\ signals an error on unknown class options; so this method
removes any extra allowed options before calling the default method
and returns the canonicalized extra options concatenated to the result
result))
-(defmethod validate-superclass ((class standard-db-class)
+(defmethod validate-superclass ((class view-metaclass)
(superclass standard-class))
t)
(pop-arg mylist))
newlist))
-(defmethod initialize-instance :around ((class standard-db-class)
+(defmethod initialize-instance :around ((class view-metaclass)
&rest all-keys
&key direct-superclasses base-table
schemas version qualifier
&allow-other-keys)
(let ((root-class (find-class 'standard-db-object nil))
- (vmc (find-class 'standard-db-class)))
+ (vmc (find-class 'view-metaclass)))
(setf (view-class-qualifier class)
(car qualifier))
(if root-class
(register-metaclass class (nth (1+ (position :direct-slots all-keys))
all-keys))))
-(defmethod reinitialize-instance :around ((class standard-db-class)
+(defmethod reinitialize-instance :around ((class view-metaclass)
&rest all-keys
&key base-table schemas version
direct-superclasses qualifier
&allow-other-keys)
(let ((root-class (find-class 'standard-db-object nil))
- (vmc (find-class 'standard-db-class)))
+ (vmc (find-class 'view-metaclass)))
(setf (view-table class)
(table-name-from-arg (sql-escape (or (and base-table
(if (listp base-table)
(ordered-class-slots class)))))
#+(or allegro openmcl)
-(defmethod finalize-inheritance :after ((class standard-db-class))
+(defmethod finalize-inheritance :after ((class view-metaclass))
;; KMRL for slots without a type set, openmcl sets type-predicate to ccl:false
- ;; for standard-db-class
+ ;; for view-metaclass
#+openmcl
(mapcar
#'(lambda (s)
standard-effective-slot-definition)
())
-(defmethod direct-slot-definition-class ((class standard-db-class)
+(defmethod direct-slot-definition-class ((class view-metaclass)
#+kmr-normal-dsdc &rest
initargs)
(declare (ignore initargs))
(find-class 'view-class-direct-slot-definition))
-(defmethod effective-slot-definition-class ((class standard-db-class)
+(defmethod effective-slot-definition-class ((class view-metaclass)
#+kmr-normal-esdc &rest
initargs)
(declare (ignore initargs))
(class-precedence-list class))
#-(or sbcl cmu)
-(defmethod compute-slots ((class standard-db-class))
+(defmethod compute-slots ((class view-metaclass))
"Need to sort order of class slots so they are the same across
implementations."
(let ((slots (call-next-method))
desired-sequence
output-slots)
-
(dolist (c (compute-class-precedence-list class))
(dolist (s (class-direct-slots c))
(let ((name (slot-definition-name s)))
(unless (find name desired-sequence)
- (setq desired-sequence (append desired-sequence (list name)))))))
- ;; desired-sequence is reversed at this time
+ (push name desired-sequence)))))
(dolist (desired desired-sequence)
(let ((slot (find desired slots :key #'slot-definition-name)))
(assert slot)
(push slot output-slots)))
-
- (nreverse output-slots)))
+ output-slots))
(defun compute-lisp-type-from-slot-specification (slotd specified-type)
"Computes the Lisp type for a user-specified type. Needed for OpenMCL
;; what kind of database value (if any) is stored there, generates and
;; verifies the column name.
-(defmethod compute-effective-slot-definition ((class standard-db-class)
+(defmethod compute-effective-slot-definition ((class view-metaclass)
#+kmr-normal-cesd slot-name
direct-slots)
#+kmr-normal-cesd (declare (ignore slot-name))
(defun slotdef-for-slot-with-class (slot class)
(find-if #'(lambda (d) (eql slot (slot-definition-name d)))
- (ordered-class-slots class)))
+ (class-slots class)))
#+ignore
(eval-when (:compile-toplevel :load-toplevel :execute)