(defun get-producer-id (name) (or (query (:select 'id :from 'producer :where (:= 'name name))) (let ((new-producer (make-instance 'producer :name name)) (insert-dao new-producer) (get-id new-producer))))
(Actually, now that I think about it, this would probably not be thread-safe. I'll see if I can figure out a better approach.)
Cheers, Marijn