Examples of Gallery


Examples of org.apache.art.Gallery

    public void testUnregisterThenRegister() throws Exception {
        DataContext context = createDataContext();

        // Create a gallery.
        Gallery g = context.newObject(Gallery.class);
        g.setGalleryName("Test Gallery");

        // Create an artist in the same context.
        Artist a = context.newObject(Artist.class);
        a.setArtistName("Test Artist");
View Full Code Here

Examples of org.apache.art.Gallery

        q.addPrefetch("exhibitArray.artistExhibitArray");

        List galleries = context.performQuery(q);
        assertEquals(1, galleries.size());

        Gallery g2 = (Gallery) galleries.get(0);

        // this relationship wasn't explicitly prefetched....
        Object list = g2.readPropertyDirectly("exhibitArray");
        assertTrue(list instanceof Fault);

        // however the target objects must be resolved
        ArtistExhibit ae1 = (ArtistExhibit) context.getGraphManager().getNode(oid1);
        ArtistExhibit ae2 = (ArtistExhibit) context.getGraphManager().getNode(oid2);
View Full Code Here

Examples of org.apache.art.Gallery

        q.addPrefetch("exhibitArray.artistExhibitArray");

        List galleries = context.performQuery(q);
        assertEquals(1, galleries.size());

        Gallery g2 = (Gallery) galleries.get(0);

        // this relationship should be resolved
        assertTrue(g2.readPropertyDirectly("exhibitArray") instanceof ValueHolder);
        List exhibits = (List) g2.readPropertyDirectly("exhibitArray");
        assertFalse(((ValueHolder) exhibits).isFault());
        assertEquals(1, exhibits.size());

        Exhibit e1 = (Exhibit) exhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, e1.getPersistenceState());
View Full Code Here

Examples of org.apache.art.Gallery

        q.addPrefetch("exhibitArray.artistExhibitArray");

        List galleries = context.performQuery(q);
        assertEquals(1, galleries.size());

        Gallery g2 = (Gallery) galleries.get(0);

        // this relationship should be resolved
        assertTrue(g2.readPropertyDirectly("exhibitArray") instanceof ValueHolder);
        List exhibits = (List) g2.readPropertyDirectly("exhibitArray");
        assertFalse(((ValueHolder) exhibits).isFault());
        assertEquals(1, exhibits.size());

        Exhibit e1 = (Exhibit) exhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, e1.getPersistenceState());
View Full Code Here

Examples of org.apache.art.Gallery

                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        List galleries = context.performQuery(q);
        assertEquals(1, galleries.size());

        Gallery g2 = (Gallery) galleries.get(0);

        // this relationship should be resolved
        assertTrue(g2.readPropertyDirectly("exhibitArray") instanceof ValueHolder);
        List exhibits = (List) g2.readPropertyDirectly("exhibitArray");
        assertFalse(((ValueHolder) exhibits).isFault());
        assertEquals(1, exhibits.size());

        Exhibit e1 = (Exhibit) exhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, e1.getPersistenceState());
View Full Code Here

Examples of org.apache.art.Gallery

        ArcProperty toGallery = (ArcProperty) d.getProperty("toGallery");

        ObjectDiff diff = context.getObjectStore().registerDiff(p1.getObjectId(), null);
        assertFalse(DataRowUtils.isToOneTargetModified(toGallery, p1, diff));

        Gallery g1 = (Gallery) context.newObject("Gallery");
        g1.addToPaintingArray(p1);
        assertTrue(DataRowUtils.isToOneTargetModified(toGallery, p1, diff));
    }
View Full Code Here

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

    public void testUnregisterThenRegister() throws Exception {
        DataContext context = createDataContext();

        // Create a gallery.
        Gallery g = context.newObject(Gallery.class);
        g.setGalleryName("Test Gallery");

        // Create an artist in the same context.
        Artist a = context.newObject(Artist.class);
        a.setArtistName("Test Artist");
View Full Code Here

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

               
        List<?> objects = context.performQuery(query);

        assertNotNull(objects);
        assertEquals(1, objects.size());
        Gallery gallery = (Gallery) objects.get(0);
        assertEquals("gallery2", gallery.getGalleryName());
       
    }
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.getContext();

        // 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.