Examples of ArtistExhibit


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

        List<ArtistExhibit> aexhibits = (List<ArtistExhibit>) e1
                .readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(2, aexhibits.size());

        ArtistExhibit ae1 = aexhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, ae1.getPersistenceState());
    }
View Full Code Here

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

        List<ArtistExhibit> aexhibits = (List<ArtistExhibit>) e1
                .readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(2, aexhibits.size());

        ArtistExhibit ae1 = aexhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, ae1.getPersistenceState());
    }
View Full Code Here

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

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

        ArtistExhibit ae1 = context.newObject(ArtistExhibit.class);
        ae1.setToArtist(a1);
        ae1.setToExhibit(e1);

        // *** TESTING THIS ***
        context.commitChanges();
    }
View Full Code Here

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

        Gallery gallery = (Gallery) context.newObject("Gallery");
        gallery.setGalleryName("A Name");

        anExhibit.setToGallery(gallery);

        ArtistExhibit artistExhibit = (ArtistExhibit) context.newObject("ArtistExhibit");

        artistExhibit.setToArtist(anArtist);
        artistExhibit.setToExhibit(anExhibit);
        context.commitChanges();

        context.deleteObjects(anArtist);

        // Test that the link record was deleted, and removed from the relationship
        assertEquals(PersistenceState.DELETED, artistExhibit.getPersistenceState());
        assertFalse(anArtist.getArtistExhibitArray().contains(artistExhibit));
        context.commitChanges();
    }
View Full Code Here

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

    }

    public void testReadNestedPropertyToManyInMiddle() throws Exception {

        Artist a = context.newObject(Artist.class);
        ArtistExhibit ex = context.newObject(ArtistExhibit.class);
        Painting p1 = context.newObject(Painting.class);
        Painting p2 = context.newObject(Painting.class);
        p1.setPaintingTitle("p1");
        p2.setPaintingTitle("p2");
        a.addToPaintingArray(p1);
        a.addToPaintingArray(p2);
        ex.setToArtist(a);

        List<String> names = (List<String>) a
                .readNestedProperty("paintingArray.paintingTitle");
        assertEquals(names.size(), 2);
        assertEquals(names.get(0), "p1");
        assertEquals(names.get(1), "p2");

        List<String> names2 = (List<String>) ex
                .readNestedProperty("toArtist.paintingArray.paintingTitle");
        assertEquals(names, names2);
    }
View Full Code Here

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

    }

    public void testReadNestedPropertyToManyInMiddle1() throws Exception {

        Artist a = context.newObject(Artist.class);
        ArtistExhibit ex = context.newObject(ArtistExhibit.class);
        Painting p1 = context.newObject(Painting.class);
        Painting p2 = context.newObject(Painting.class);
        p1.setPaintingTitle("p1");
        p2.setPaintingTitle("p2");
        a.addToPaintingArray(p1);
        a.addToPaintingArray(p2);
        ex.setToArtist(a);

        List<String> names = (List<String>) a
                .readNestedProperty("paintingArray+.paintingTitle");
        assertEquals(names.size(), 2);
        assertEquals(names.get(0), "p1");
        assertEquals(names.get(1), "p2");

        List<String> names2 = (List<String>) ex
                .readNestedProperty("toArtist.paintingArray+.paintingTitle");
        assertEquals(names, names2);
    }
View Full Code Here

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

                assertFalse(((ValueHolder) exibits).isFault());
                assertEquals(2, exibits.size());

                Iterator<ArtistExhibit> exibitsIterator = exibits.iterator();
                while (exibitsIterator.hasNext()) {
                    ArtistExhibit ae = exibitsIterator.next();
                    assertEquals(PersistenceState.COMMITTED, ae.getPersistenceState());
                    assertNotNull(ae.getObjectId());

                }
            }
        });
    }
View Full Code Here

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

        e1.setClosingDate(new Date());

        context.commitChanges();

        // *** TESTING THIS ***
        ArtistExhibit ae1 = context.newObject(ArtistExhibit.class);
        e1.addToArtistExhibitArray(ae1);
        a1.addToArtistExhibitArray(ae1);

        // check before save
        assertSame(e1, ae1.getToExhibit());
        assertSame(a1, ae1.getToArtist());

        // save
        // test "assertion" is that commit succeeds (PK of ae1 was set properly)
        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.