Package org.apache.cayenne.graph

Examples of org.apache.cayenne.graph.GraphDiff.apply()


                GraphDiff serverDiff = super
                        .onSync(originatingContext, changes, syncType);

                assertNotNull(serverDiff);
                serverDiff.apply(diffReader);
                return serverDiff;
            }
        };

        CayenneContext context = new CayenneContext(channel);
View Full Code Here


                SnapshotEvent decoratedEvent = ((SnapshotEventDecorator) diff).getEvent();
                context.getObjectStore().processSnapshotEvent(decoratedEvent);
            }
            else {
                synchronized (context.getObjectStore()) {
                    diff.apply(this);
                }
            }

            // repost channel change event for our own children
            context.fireDataChannelChanged(event.getPostedBy(), event.getDiff());
View Full Code Here

                // check that arc changes got recorded in the parent context
                GraphDiff diffs = clientContext.internalGraphManager().getDiffs();
                final int[] arcDiffs = new int[1];

                diffs.apply(new GraphChangeHandler() {

                    public void arcCreated(
                            Object nodeId,
                            Object targetNodeId,
                            Object arcId) {
View Full Code Here

                // check that arc changes got recorded in the parent context
                GraphDiff diffs = clientContext.internalGraphManager().getDiffs();

                final int[] modifiedProperties = new int[1];

                diffs.apply(new GraphChangeHandler() {

                    public void arcCreated(
                            Object nodeId,
                            Object targetNodeId,
                            Object arcId) {
View Full Code Here

        GraphDiff diffs = clientContext.internalGraphManager().getDiffs();

        final int[] arcDiffs = new int[1];
        final int[] newNodes = new int[1];

        diffs.apply(new GraphChangeHandler() {

            public void arcCreated(Object nodeId, Object targetNodeId, Object arcId) {
                arcDiffs[0]++;
            }
View Full Code Here

        GraphDiff diffs = clientContext.internalGraphManager().getDiffs();

        final int[] arcDiffs = new int[1];
        final int[] newNodes = new int[1];

        diffs.apply(new GraphChangeHandler() {

            public void arcCreated(Object nodeId, Object targetNodeId, Object arcId) {
                arcDiffs[0]++;
            }
View Full Code Here

                newIds[0] = newId;
            }
        };

        diff.apply(diffChecker);
        assertEquals(1, diffChecker.getCallbackCount());
        assertSame(a.getObjectId(), newIds[0]);

        // commit a mix of new and modified
        Painting p = context.newObject(Painting.class);
View Full Code Here

                newIds2[0] = newId;
            }
        };

        diff2.apply(diffChecker2);
        assertEquals(1, diffChecker2.getCallbackCount());
        assertSame(p.getObjectId(), newIds2[0]);

        // commit new object with uninitialized attributes
View Full Code Here

                GraphDiff serverDiff = super
                        .onSync(originatingContext, changes, syncType);

                assertNotNull(serverDiff);
                serverDiff.apply(diffReader);
                return serverDiff;
            }
        };

        CayenneContext context = new CayenneContext(channel);
View Full Code Here

                            originatingContext,
                            changes,
                            syncType);

                    assertNotNull(serverDiff);
                    serverDiff.apply(diffReader);
                    return serverDiff;
                }
            };

            CayenneContext context = new CayenneContext(channel);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.