Re: Subclassing EOEditingContext
Re: Subclassing EOEditingContext
- Subject: Re: Subclassing EOEditingContext
- From: Kieran Kelleher <email@hidden>
- Date: Mon, 2 Jul 2007 16:53:26 -0400
MyEditingContext extends EOEditingContext
EOEditingContext ec = new MyEditingContext();
.... if you are using Wonder, you need to examine the ERXEC factory
and make your own factory to return your subclass of ERXEC. Specify
the custom factory in Properties somewhere ...... just poke around in
ERXEC and you'll figure it out
MyEditingContext extends ERXEC
Example custom factory:
public class WKEditingContextFactory extends ERXEC.DefaultFactory {
public WKEditingContextFactory() {
super();
}
protected EOEditingContext _createEditingContext(EOObjectStore
parent) {
EOEditingContext newEc = new WKEditingContext(parent ==
null ? EOEditingContext.defaultParentObjectStore() : parent);
long currentTime = System.currentTimeMillis();
// Cannot set fetch timestamp on child ec's!!
if (!(parent instanceof EOEditingContext)) {
newEc.setFetchTimestamp( currentTime -
ERXProperties.intForKeyWithDefault
( "EOEditingContextDefaultFetchTimestampLag", 360000 ) );
}
return newEc;
}
}
On Jul 2, 2007, at 4:17 PM, Ricardo Strausz wrote:
Hola!
What is the best practice to subclass the EOEditingContext (besides
not subclassing at all)?
Some experience on that?
Dino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden