Package org.apache.art

Examples of org.apache.art.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());

            }

        }
        finally {
View Full Code Here


        // 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);

        assertNotNull(ae1);
        assertNotNull(ae2);
        assertEquals(PersistenceState.COMMITTED, ae1.getPersistenceState());
        assertEquals(PersistenceState.COMMITTED, ae2.getPersistenceState());
    }
View Full Code Here

        assertTrue(e1.readPropertyDirectly("artistExhibitArray") instanceof ValueHolder);
        List aexhibits = (List) e1.readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(1, exhibits.size());

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

        assertTrue(e1.readPropertyDirectly("artistExhibitArray") instanceof ValueHolder);
        List aexhibits = (List) e1.readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(2, aexhibits.size());

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

        assertTrue(e1.readPropertyDirectly("artistExhibitArray") instanceof ValueHolder);
        List aexhibits = (List) e1.readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(2, aexhibits.size());

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

            List toMany = (List) a1.readPropertyDirectly("artistExhibitArray");
            assertNotNull(toMany);
            assertFalse(((ValueHolder) toMany).isFault());
            assertEquals(2, toMany.size());

            ArtistExhibit artistExhibit = (ArtistExhibit) toMany.get(0);
            assertEquals(PersistenceState.COMMITTED, artistExhibit.getPersistenceState());
            assertSame(a1, artistExhibit.getToArtist());
        }
        finally {
            unblockQueries();
        }
    }
View Full Code Here

            List toMany = (List) a1.readPropertyDirectly("artistExhibitArray");
            assertNotNull(toMany);
            assertFalse(((ValueHolder) toMany).isFault());
            assertEquals(2, toMany.size());

            ArtistExhibit artistExhibit = (ArtistExhibit) toMany.get(0);
            assertEquals(PersistenceState.COMMITTED, artistExhibit.getPersistenceState());
            assertSame(a1, artistExhibit.getToArtist());
        }
        finally {
            unblockQueries();
        }
    }
View Full Code Here

        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.deleteObject(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

   
    public void testReadNestedPropertyToManyInMiddle() throws Exception {
        DataContext context = createDataContext();
       
        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

   
    public void testReadNestedPropertyToManyInMiddle1() throws Exception {
        DataContext context = createDataContext();
       
        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

TOP

Related Classes of org.apache.art.ArtistExhibit

Copyright © 2018 www.massapicom. 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.