Package org.apache.cayenne.intercept

Examples of org.apache.cayenne.intercept.DataChannelCallbackInterceptor


            }
        }
    }

    void enableCallbacks() {
        DataChannelCallbackInterceptor interceptor = new DataChannelCallbackInterceptor();

        // must call pre-persist and pre-remove on commit
        interceptor.setContextCallbacksEnabled(true);
        interceptor.setChannel(serverContext.getParentDataDomain());

        serverContext.setChannel(interceptor);
    }
View Full Code Here


     * Creates a new Cayenne {@link ObjectContext} based on this factory DataDomain.
     * Returned context has lifecycle callbacks enabled, as expected in the JPA
     * environment.
     */
    protected ObjectContext createObjectContext() {
        DataChannelCallbackInterceptor postInterceptor = new DataChannelCallbackInterceptor();
        postInterceptor.setChannel(domain);
        ObjectStore objectStore = new ObjectStore(domain.getSharedSnapshotCache());

        ObjectContextCallbackInterceptor preInterceptor = new ObjectContextCallbackInterceptor();
        preInterceptor.setContext(new DataContext(postInterceptor, objectStore));

View Full Code Here

TOP

Related Classes of org.apache.cayenne.intercept.DataChannelCallbackInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.