X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Foodml.lisp;h=7f606636631fb913e8d4624c8c371f7e6f155946;hp=142e51631d1f246eb19f8abb1a449d24ec0bd247;hb=952ec6d5f4eeec95f2b9b077a49723b51912d38c;hpb=4953933acb0e3349254ddfe6b1af6cc903cb5ce3 diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 142e516..7f60663 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -737,21 +737,29 @@ maximum of MAX-LEN instances updated in each query." keys)) :result-types :auto :flatp t))) + (dolist (object objects) (when (or force-p (not (slot-boundp object slotdef-name))) - (let ((res (find (slot-value object home-key) results - :key #'(lambda (res) (slot-value res foreign-key)) - :test #'equal))) + (let ((res (remove-if-not #'(lambda (obj) + (equal obj (slot-value + object + home-key))) + results + :key #'(lambda (res) + (slot-value res + foreign-key))))) (when res - (setf (slot-value object slotdef-name) res))))))))))) + (setf (slot-value object slotdef-name) + (if (gethash :set dbi) res (car res))))))))))))) (values)) - + (defun fault-join-slot-raw (class object slot-def) (let* ((dbi (view-class-slot-db-info slot-def)) (jc (gethash :join-class dbi))) (let ((jq (join-qualifier class object slot-def))) (when jq - (select jc :where jq :flatp t :result-types nil))))) + (select jc :where jq :flatp t :result-types nil + :database (view-database object)))))) (defun fault-join-slot (class object slot-def) (let* ((dbi (view-class-slot-db-info slot-def)) @@ -1148,7 +1156,8 @@ as elements of a list." (unless (record-caches database) (setf (record-caches database) (make-hash-table :test 'equal - #+allegro :values #+allegro :weak + #+allegro :values #+allegro :weak + #+clisp :weak #+clisp :value #+lispworks :weak-kind #+lispworks :value))) (setf (gethash (compute-records-cache-key targets qualifiers) (record-caches database)) results)