Name

INSTANCE-REFRESHED — User hook to call on object refresh.Generic function

Syntax

      instance-refreshed object => 

Arguments and Values

object

The View Class object which is being refreshed.

Description

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.

Examples

(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"
      

Side Effects

The user hook function may cause side effects.

Exceptional Situations

None.

See Also

select

Notes

None.