INSTANCE-REFRESHED — User hook to call on object refresh.Generic function
Provides a hook which is called within an object oriented
call to select
with a non-nil value of
refresh
when the View Class instance
object
has been updated from the
database. A method specialised on
standard-db-object is provided which has no
effects. Methods specialised on particular View Classes can be
used to specify any operations that need to be made on View
Classes instances which have been updated in calls to
select
.
(slot-value employee1 'email) => "lenin@soviet.org" (defmethod instance-refreshed ((e employee)) (format t "~&Details for ~A ~A have been updated from the database." (slot-value e 'first-name) (slot-value e 'last-name))) => #<Standard-Method INSTANCE-REFRESHED (EMPLOYEE) {48174D9D}> (select 'employee :where [= [slot-value 'employee 'emplid] 1] :flatp t) => (#<EMPLOYEE {48149995}>) (slot-value (car *) 'email) => "lenin@soviet.org" (update-records [employee] :av-pairs '(([email] "v.lenin@soviet.org")) :where [= [emplid] 1]) => (select 'employee :where [= [slot-value 'employee 'emplid] 1] :flatp t) => (#<EMPLOYEE {48149995}>) (slot-value (car *) 'email) => "lenin@soviet.org" (select 'employee :where [= [slot-value 'employee 'emplid] 1] :flatp t :refresh t) Details for Vladimir Lenin have been updated from the database. => (#<EMPLOYEE {48149995}>) (slot-value (car *) 'email) => "v.lenin@soviet.org"