Examples of localObject()


Examples of org.apache.cayenne.ObjectContext.localObject()

        altA.setArtistName("Y");
        context.commitChanges();

        ObjectContext peer1 = context.createChildContext();
        Painting p1 = (Painting) peer1.localObject(p.getObjectId(), p);
        Artist altA1 = (Artist) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = context.createChildContext();
        Painting p2 = (Painting) peer2.localObject(p.getObjectId(), p);
        Artist altA2 = (Artist) peer2.localObject(altA.getObjectId(), altA);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        ObjectContext peer1 = context.createChildContext();
        Painting p1 = (Painting) peer1.localObject(p.getObjectId(), p);
        Artist altA1 = (Artist) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = context.createChildContext();
        Painting p2 = (Painting) peer2.localObject(p.getObjectId(), p);
        Artist altA2 = (Artist) peer2.localObject(altA.getObjectId(), altA);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);

        p1.setToArtist(altA1);
        assertSame(a2, p2.getToArtist());
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        Painting p1 = (Painting) peer1.localObject(p.getObjectId(), p);
        Artist altA1 = (Artist) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = context.createChildContext();
        Painting p2 = (Painting) peer2.localObject(p.getObjectId(), p);
        Artist altA2 = (Artist) peer2.localObject(altA.getObjectId(), altA);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);

        p1.setToArtist(altA1);
        assertSame(a2, p2.getToArtist());
        peer1.commitChangesToParent();
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        Artist altA1 = (Artist) peer1.localObject(altA.getObjectId(), altA);

        ObjectContext peer2 = context.createChildContext();
        Painting p2 = (Painting) peer2.localObject(p.getObjectId(), p);
        Artist altA2 = (Artist) peer2.localObject(altA.getObjectId(), altA);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);

        p1.setToArtist(altA1);
        assertSame(a2, p2.getToArtist());
        peer1.commitChangesToParent();
        assertEquals(altA2, p2.getToArtist());
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        py.setPaintingTitle("PY");

        context.commitChanges();

        ObjectContext peer1 = context.createChildContext();
        Painting py1 = (Painting) peer1.localObject(py.getObjectId(), py);
        Artist a1 = (Artist) peer1.localObject(a.getObjectId(), a);

        ObjectContext peer2 = context.createChildContext();
        Painting py2 = (Painting) peer2.localObject(py.getObjectId(), py);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        context.commitChanges();

        ObjectContext peer1 = context.createChildContext();
        Painting py1 = (Painting) peer1.localObject(py.getObjectId(), py);
        Artist a1 = (Artist) peer1.localObject(a.getObjectId(), a);

        ObjectContext peer2 = context.createChildContext();
        Painting py2 = (Painting) peer2.localObject(py.getObjectId(), py);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        ObjectContext peer1 = context.createChildContext();
        Painting py1 = (Painting) peer1.localObject(py.getObjectId(), py);
        Artist a1 = (Artist) peer1.localObject(a.getObjectId(), a);

        ObjectContext peer2 = context.createChildContext();
        Painting py2 = (Painting) peer2.localObject(py.getObjectId(), py);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);

        a1.addToPaintingArray(py1);
        assertEquals(1, a2.getPaintingArray().size());
        assertFalse(a2.getPaintingArray().contains(py2));
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        Painting py1 = (Painting) peer1.localObject(py.getObjectId(), py);
        Artist a1 = (Artist) peer1.localObject(a.getObjectId(), a);

        ObjectContext peer2 = context.createChildContext();
        Painting py2 = (Painting) peer2.localObject(py.getObjectId(), py);
        Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);

        a1.addToPaintingArray(py1);
        assertEquals(1, a2.getPaintingArray().size());
        assertFalse(a2.getPaintingArray().contains(py2));
        peer1.commitChangesToParent();
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        ObjectContext child = context.createChildContext();
       
        Painting painting = child.newObject(Painting.class);
        painting.setPaintingTitle("222");
       
        Artist localParentMt = (Artist) child.localObject(artist.getObjectId(), null);
        assertEquals(0, artist.getPaintingArray().size());
        assertEquals(0, localParentMt.getPaintingArray().size());
       
        painting.setToArtist(localParentMt);
       
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.localObject()

        MockChannelListener listener = new MockChannelListener();
        EventUtil.listenForChannelEvents(context, listener);

        ObjectContext child = context.createChildContext();
        Artist a1 = (Artist) child.localObject(a.getObjectId(), a);

        a1.setArtistName("Y");
        child.commitChangesToParent();

        assertFalse(listener.graphCommitted);
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.