Examples of Gallery


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

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

    public void testPropagatePK() throws Exception {
        // setup data
        Gallery g1 = newGallery();
        Exhibit e1 = newExhibit(g1);
        Artist a1 = newArtist();
        ctxt.commitChanges();

        // *** TESTING THIS ***
 
View Full Code Here

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

        Exhibit anExhibit = (Exhibit) context.newObject("Exhibit");
        anExhibit.setClosingDate(new java.sql.Timestamp(System.currentTimeMillis()));
        anExhibit.setOpeningDate(new java.sql.Timestamp(System.currentTimeMillis()));

        // Needs a gallery... required for data integrity
        Gallery gallery = (Gallery) context.newObject("Gallery");
        gallery.setGalleryName("A Name");

        anExhibit.setToGallery(gallery);

        ArtistExhibit artistExhibit = (ArtistExhibit) context.newObject("ArtistExhibit");
View Full Code Here

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

        context.commitChanges();
    }

    public void testDenyToMany() {
        // 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

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

    protected ArtistExhibit newArtistExhibit() {
        return (ArtistExhibit) ctxt.newObject("ArtistExhibit");
    }

    protected Gallery newGallery() {
        Gallery g1 = (Gallery) ctxt.newObject("Gallery");
        g1.setGalleryName(galleryName);
        return g1;
    }
View Full Code Here

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

    }

    /** Tests how primary key is propagated from one new object to another. */
    public void testNewAdd2() throws Exception {
        Artist a1 = this.newArtist();
        Gallery g1 = context.newObject(Gallery.class);
        g1.setGalleryName(galleryName);

        Exhibit e1 = context.newObject(Exhibit.class);
        e1.setOpeningDate(new Timestamp(System.currentTimeMillis()));
        e1.setClosingDate(new Timestamp(System.currentTimeMillis()));
        e1.setToGallery(g1);
View Full Code Here

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

    public void testPropagatePK() throws Exception {
        Artist a1 = context.newObject(Artist.class);
        a1.setArtistName("XyBn");

        Gallery g1 = context.newObject(Gallery.class);
        g1.setGalleryName("Tyu");

        Exhibit e1 = context.newObject(Exhibit.class);
        e1.setToGallery(g1);
        e1.setOpeningDate(new Date());
        e1.setClosingDate(new Date());
View Full Code Here

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

    public void testReadToOneRel3() throws Exception {
        createArtistWithPaintingDataSet();

        Painting p1 = Cayenne.objectForPK(context, Painting.class, 6);
        Gallery g1 = p1.getToGallery();
        assertNull(g1);
    }
View Full Code Here

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

        p.setPaintingTitle("P1");

        Artist a = context.newObject(Artist.class);
        a.setArtistName("A1");

        Gallery g = context.newObject(Gallery.class);
        g.setGalleryName("G1");

        p.setToArtist(a);
        p.setToGallery(g);
        context.commitChanges();
View Full Code Here

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

    public void testSelectViaMultiRelationship() throws Exception {

        createArtistWithPaintingsInGalleryDataSet();

        Artist a1 = Cayenne.objectForPK(context, Artist.class, 8);
        Gallery g1 = Cayenne.objectForPK(context, Gallery.class, 11);

        Expression e = ExpressionFactory.matchExp("paintingArray.toGallery", g1);
        SelectQuery q = new SelectQuery("Artist", e);

        List<Artist> artists = context.performQuery(q);
View Full Code Here

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

    public void testRemove() throws Exception {
        Painting p1 = context.newObject(Painting.class);
        p1.setPaintingTitle("xa");

        Gallery g1 = context.newObject(Gallery.class);
        g1.setGalleryName("yT");

        p1.setToGallery(g1);

        // do save
        context.commitChanges();

        ObjectContext context2 = runtime.newContext();

        // test database data
        Painting p2 = (Painting) Cayenne.objectForQuery(context2, new SelectQuery(
                Painting.class));
        Gallery g2 = p2.getToGallery();

        p2.setToGallery(null);

        // test before save
        assertEquals(0, g2.getPaintingArray().size());
        assertNull(p2.getToGallery());

        // do save II
        context2.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.