Package org.apache.cayenne.graph

Examples of org.apache.cayenne.graph.GraphDiff


    public void commitChanges() {
        doCommitChanges();
    }

    GraphDiff doCommitChanges() {
        GraphDiff commitDiff = null;

        synchronized (graphManager) {

            if (graphManager.hasChanges()) {
View Full Code Here


    public void rollbackChanges() {
        synchronized (graphManager) {
            if (graphManager.hasChanges()) {

                GraphDiff diff = graphManager.getDiffs();
                graphManager.graphReverted();

                channel.onSync(this, diff, DataChannel.ROLLBACK_CASCADE_SYNC);
            }
        }
View Full Code Here

    }

    public void commitChangesToParent() {
        synchronized (graphManager) {
            if (graphManager.hasChangesSinceLastFlush()) {
                GraphDiff diff = graphManager.getDiffsSinceLastFlush();
                graphManager.graphFlushed();
                channel.onSync(this, diff, DataChannel.FLUSH_NOCASCADE_SYNC);
            }
        }
    }
View Full Code Here

     * performs cascading rollback of all parent DataContexts.
     */
    public void rollbackChanges() {

        if (objectStore.hasChanges()) {
            GraphDiff diff = getObjectStore().getChanges();
            getObjectStore().objectsRolledBack();

            if (channel != null) {
                channel.onSync(this, null, DataChannel.ROLLBACK_CASCADE_SYNC);
            }
View Full Code Here

                eventHandler.registerForDataContextEvents();
                fireWillCommit();
            }

            try {
                GraphDiff returnChanges = getChannel().onSync(this, changes, syncType);
                getObjectStore().postprocessAfterCommit(returnChanges);

                // this is a legacy event ... will deprecate in 2.0
                fireTransactionCommitted();

                // this event is caught by peer nested DataContexts to synchronize the
                // state
                fireDataChannelCommitted(this, changes);

                // this event is caught by child DataContexts to update temporary
                // ObjectIds with permanent
                if (!returnChanges.isNoop()) {
                    fireDataChannelCommitted(getChannel(), returnChanges);
                }

                return returnChanges;
            }
View Full Code Here

        int syncType = cascade
                ? DataChannel.FLUSH_CASCADE_SYNC
                : DataChannel.FLUSH_NOCASCADE_SYNC;

        GraphDiff commitDiff = null;

        synchronized (graphManager) {

            if (graphManager.hasChanges()) {
View Full Code Here

    @Override
    public void rollbackChanges() {
        synchronized (graphManager) {
            if (graphManager.hasChanges()) {

                GraphDiff diff = graphManager.getDiffs();
                graphManager.graphReverted();

                channel.onSync(this, diff, DataChannel.ROLLBACK_CASCADE_SYNC);
            }
        }
View Full Code Here

        processIndirectlyModifiedIDs(event.getIndirectlyModifiedIds());

        // TODO: andrus, 3/28/2006 - 'SnapshotEventDecorator' serves as a bridge (or
        // rather a noop wrapper) between old snapshot events and new GraphEvents. Once
        // SnapshotEvents are replaced with GraphEvents (in 2.0) we won't need it
        GraphDiff diff = new SnapshotEventDecorator(event);

        ObjectContext originatingContext = (event.getPostedBy() instanceof ObjectContext)
                ? (ObjectContext) event.getPostedBy()
                : null;
        context.fireDataChannelChanged(originatingContext, diff);
View Full Code Here

     * @since 1.2
     */
    @Override
    public void rollbackChangesLocally() {
        if (objectStore.hasChanges()) {
            GraphDiff diff = getObjectStore().getChanges();

            getObjectStore().objectsRolledBack();
            fireDataChannelRolledback(this, diff);
        }
    }
View Full Code Here

     */
    @Override
    public void rollbackChanges() {

        if (objectStore.hasChanges()) {
            GraphDiff diff = getObjectStore().getChanges();

            // call channel with changes BEFORE reverting them, so that any interceptors
            // could record them

            if (channel != null) {
View Full Code Here

TOP

Related Classes of org.apache.cayenne.graph.GraphDiff

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.