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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists% 40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to