Cache Persistent 클래스는
다음과 같은 메소드를 overriding할 수 있도록 되어 있습니다.
오브젝트로 %Save()호출시에 이 메소드가 먼저
호출됩니다.
예제 소스를 보시고
참고하시기 바랍니다.
Class A Extends (%Persistent) {
Property LastModifiedAs%Date;
Property
RegDateAs%Date;
/// /// This callback
method is invoked by the <METHOD>%Save</METHOD> method
to
/// provide
notification that the object is being saved. It is called
before /// any data is
written to disk.
/// ///
<P><VAR>insert</VAR> will be set to 1 if this
object is being saved for the first time.
/// /// <P>If this
method returns an error then the call to
<METHOD>%Save</METHOD> will fail.
Method
%OnBeforeSave(insert As
%Boolean) As %Status [ Private ]
{
ifinsert
s
..RegDate=$h
s ..LastModified= $h
quit$$$OK
}
...
}
|