Examples of addToPaintingArray()


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

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

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

        blockQueries();

        Painting parentModifiedSimple = null;
        Artist parentModifiedToMany = 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.deleteObject(p2);
View Full Code Here

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

        assertTrue("List must be unresolved...", list.isFault());

        Painting p2 = context.newObject(Painting.class);
        p2.setPaintingTitle("p2");

        artist.addToPaintingArray(p1);
        artist.addToPaintingArray(p2);
        assertTrue("List must be unresolved...", list.isFault());

        context.commitChanges();
View Full Code Here

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

        Painting p2 = context.newObject(Painting.class);
        p2.setPaintingTitle("p2");

        artist.addToPaintingArray(p1);
        artist.addToPaintingArray(p2);
        assertTrue("List must be unresolved...", list.isFault());

        context.commitChanges();

        assertTrue("List must be unresolved...", list.isFault());
View Full Code Here

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

        Artist artist = context.newObject(Artist.class);
        artist.setArtistName("aaa");

        Painting p1 = context.newObject(Painting.class);
        p1.setPaintingTitle("p1");
        artist.addToPaintingArray(p1);
        context.commitChanges();
        context.invalidateObjects(Collections.singletonList(artist));

        ToManyList list = (ToManyList) artist.getPaintingArray();
        assertTrue("List must be unresolved...", list.isFault());
View Full Code Here

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

        ToManyList list = (ToManyList) artist.getPaintingArray();
        assertTrue("List must be unresolved...", list.isFault());

        Painting p2 = context.newObject(Painting.class);

        artist.addToPaintingArray(p2);
        assertTrue("List must be unresolved...", list.isFault());
        assertTrue(addedToUnresolved(list).contains(p2));

        context.rollbackChanges();
View Full Code Here

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

        Painting p = ctxt.newObject(Painting.class);
        p.setPaintingTitle("A Painting");
        // converting double to string prevents rounding weirdness...
        p.setEstimatedPrice(new BigDecimal("" + paintingPrice));
        a.addToPaintingArray(p);

        ctxt.commitChanges();
    }

    /**
 
View Full Code Here

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

        assertNull(painting.getToArtist()); // Make sure it wasn't set

        // Now try the reverse (toMany) relationship
        try {
            artist.addToPaintingArray(painting);
            fail("Should have failed to add a cross-context relationship");
        }
        catch (CayenneRuntimeException e) {
            // Fine.. it should throw an exception
        }
View Full Code Here

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

        context.commitChanges();

        // Cause an update and an insert that need correct ordering
        Painting painting = context.newObject(Painting.class);
        painting.setPaintingTitle("a painting");
        artist.addToPaintingArray(painting);

        context.commitChanges();

        context.deleteObject(artist);
        context.commitChanges();
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.