Re: EO-last modified...?
Re: EO-last modified...?
- Subject: Re: EO-last modified...?
- From: Chuck Hill <email@hidden>
- Date: Mon, 7 Jun 2004 08:56:20 -0700
Your code is still modifying property values during validateForSave.
This just moves the defect to the super class.
Chuck
On Jun 7, 2004, at 1:59 AM, Dirk Bajohr wrote:
Hi,
I'm using the same concept: subclassing EOCustomObject with some
modified
/ extended code. My EOs extend the custom EO class.
I extend the methods validateForSave, awakeFromInsertion and
awakeFromClientUpdate and it works well for me.
public abstract class CustomEnterpriseObjects extends EOCustomObject {
public abstract void setChangeDate(NSTimestamp value);
public abstract NSTimestamp changeDate();
... constructor etc ...
public void validateForSave() throws ValidationException {
setChangeDate (new NSTimestamp());
super.validateForSave();
}
public void awakeFromInsertion(EOEditingContext ec) {
super.awakeFromInsertion(ec);
setChangeDate (new NSTimestamp());
}
public void awakeFromClientUpdate(EOEditingContext ec) {
super.awakeFromClientUpdate(ec);
setChangeDate (new NSTimestamp());
}
}
Hope that helps,
Dirk
Am 07.06.2004 um 01:25 schrieb MacFirst:
I have a client who wants to log a last modified date for every row
in the
database. So far, my best idea is to have every EO extend some
default EO
(i.e., Customer extends ClientEO, where ClientEO extends
EOEnterpriseObject), then override takeStoredValueForKey() in
ClientEO to
save off the modified date (obviously checking if the thing we're
storing is
the mod-date, so as to avoid infinite recursion.)
However, this solution has a somewhat hackish feel that leaves me
less than
satisfied.
Do any of you have a good clean way of doing this that you've found
to be
satisfactory both in design and implementation, and in practice,
maintenance, etc.?
Thanks!
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation
Hauptstr. 50
53757 Sankt Augustin
T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.