Examples of Painting1


Examples of org.apache.art.Painting1

        DataContext context = createDataContext();

        Artist a1 = (Artist) context.newObject("Artist");
        a1.setArtistName("a");
        Painting1 p1 = (Painting1) context.newObject("Painting1");
        p1.setPaintingTitle("p");

        // *** TESTING THIS ***
        p1.setToArtist(a1);

        assertSame(a1, p1.getToArtist());

        context.commitChanges();
        ObjectId aid = a1.getObjectId();
        ObjectId pid = p1.getObjectId();
        context.invalidateObjects(Arrays.asList(a1, p1));

        Painting1 p2 = (Painting1) DataObjectUtils.objectForPK(context, pid);
        Artist a2 = p2.getToArtist();
        assertNotNull(a2);
        assertEquals(aid, a2.getObjectId());
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Painting1

        DataContext context = createDataContext();

        Artist a1 = (Artist) context.newObject("Artist");
        a1.setArtistName("a");
        Painting1 p1 = (Painting1) context.newObject("Painting1");
        p1.setPaintingTitle("p");

        // *** TESTING THIS ***
        p1.setToArtist(a1);

        assertSame(a1, p1.getToArtist());

        context.commitChanges();
        ObjectId aid = a1.getObjectId();
        ObjectId pid = p1.getObjectId();
        context.invalidateObjects(Arrays.asList(a1, p1));

        Painting1 p2 = (Painting1) Cayenne.objectForPK(context, pid);
        Artist a2 = p2.getToArtist();
        assertNotNull(a2);
        assertEquals(aid, a2.getObjectId());
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Painting1

    public void testNewAdd() throws Exception {

        Artist a1 = context.newObject(Artist.class);
        a1.setArtistName("a");
        Painting1 p1 = context.newObject(Painting1.class);
        p1.setPaintingTitle("p");

        // TESTING THIS
        p1.setToArtist(a1);

        assertSame(a1, p1.getToArtist());

        context.commitChanges();
        ObjectId aid = a1.getObjectId();
        ObjectId pid = p1.getObjectId();
        context.invalidateObjects(a1, p1);

        Painting1 p2 = (Painting1) Cayenne.objectForPK(context, pid);
        Artist a2 = p2.getToArtist();
        assertNotNull(a2);
        assertEquals(aid, a2.getObjectId());
    }
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.