Coverage report: /home/ati/workspace/perec/persistence/common.lisp
Kind | Covered | All | % |
expression | 6 | 6 | 100.0 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;; -*- mode: Lisp; Syntax: Common-Lisp; -*-
3
;;; Copyright (c) 2006 by the authors.
5
;;; See LICENCE for details.
9
(defparameter *exporting-to-rdbms* #f)
11
(defcclass* exportable ()
13
(compute-as (export-to-rdbms -self-) -self-)
14
:reader ensure-exported
15
:documentation "A persistent class, a persistent association and the related tables must be exported before use. This will automatically happen not later than making, reviving, querying or using by any means the first instance of it.")))
17
(defgeneric export-to-rdbms (object)
18
(:documentation "Exports classes, associations, tables to the database, may create new tables or alter existing ones.")
20
(:method :around (object)
21
(if *exporting-to-rdbms*
23
(let ((*exporting-to-rdbms* #t))
25
(call-next-method))))))