Examples of addToPaintingArray()


Examples of org.apache.cayenne.testdo.testmap.Artist.addToPaintingArray()

        final ObjectContext childContext = context.createChildContext();

        Artist _new = context.newObject(Artist.class);
        final Painting _newP = context.newObject(Painting.class);
        _new.addToPaintingArray(_newP);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Painting painting = (Painting) childContext.localObject(_newP
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.addToPaintingArray()

        ObjectContext childContext = context.createChildContext();

        Artist a = Cayenne.objectForPK(childContext, Artist.class, 33001);
        Painting p = childContext.newObject(Painting.class);
        p.setPaintingTitle("X");
        a.addToPaintingArray(p);

        childContext.commitChangesToParent();

        childContext.deleteObjects(p);
        a.removeFromPaintingArray(p);
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.addToPaintingArray()

        final Artist childModifiedToMany = ((Painting) objects.get(2)).getToArtist();

        // ensure painting array is fully resolved...
        childModifiedToMany.getPaintingArray().size();
        childModifiedToMany.addToPaintingArray((Painting) objects.get(3));

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Painting parentModifiedSimple = null;
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.addToPaintingArray()

        a.setArtistName("X");
        child.commitChanges();

        Painting p1 = child.newObject(Painting.class);
        p1.setPaintingTitle("P1");
        a.addToPaintingArray(p1);

        Painting p2 = child.newObject(Painting.class);
        p2.setPaintingTitle("P2");
        a.addToPaintingArray(p2);
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.addToPaintingArray()

        p1.setPaintingTitle("P1");
        a.addToPaintingArray(p1);

        Painting p2 = child.newObject(Painting.class);
        p2.setPaintingTitle("P2");
        a.addToPaintingArray(p2);

        a.removeFromPaintingArray(p2);

        // this causes an error on commit
        child.deleteObjects(p2);
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.addToPaintingArray()

        List<?> objects = context.performQuery(new SelectQuery(Artist.class));
        Artist a1 = (Artist) objects.get(0);

        Painting p1 = context.newObject(Painting.class);
        p1.setPaintingTitle("XXX");
        a1.addToPaintingArray(p1);
        a1.resetValidationFlags();
        context.commitChanges();

        assertFalse(a1.isValidateForSaveCalled());
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Gallery.addToPaintingArray()

    }

    public void testRemove1() throws Exception {
        Painting p1 = newPainting();
        Gallery g1 = newGallery();
        g1.addToPaintingArray(p1);

        // do save
        ctxt.commitChanges();
        ctxt = createDataContext();
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Gallery.addToPaintingArray()

        assertEquals(0, g3.getPaintingArray().size());
    }

    public void testRemove2() throws Exception {
        Gallery g1 = newGallery();
        g1.addToPaintingArray(newPainting());
        g1.addToPaintingArray(newPainting());

        // do save
        ctxt.commitChanges();
        ctxt = createDataContext();
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Gallery.addToPaintingArray()

    }

    public void testRemove2() throws Exception {
        Gallery g1 = newGallery();
        g1.addToPaintingArray(newPainting());
        g1.addToPaintingArray(newPainting());

        // do save
        ctxt.commitChanges();
        ctxt = createDataContext();
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Gallery.addToPaintingArray()

        // Gallery paintingArray
        Gallery gallery = (Gallery) context.newObject("Gallery");
        gallery.setGalleryName("A Name");
        Painting painting = (Painting) context.newObject("Painting");
        painting.setPaintingTitle("A Title");
        gallery.addToPaintingArray(painting);
        context.commitChanges();

        try {
            context.deleteObject(gallery);
            fail("Should have thrown an exception");
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.