Package org.apache.cayenne.testdo.testmap

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


        // select all galleries that have exhibits by both Picasso and Dali...

        ObjectContext context = createDataContext();

        Artist picasso = Cayenne.objectForPK(context, Artist.class, 1);
        Artist dali = Cayenne.objectForPK(context, Artist.class, 2);

        SelectQuery query = new SelectQuery(Gallery.class);
        query.andQualifier(ExpressionFactory.matchAllExp(
                "|exhibitArray.artistExhibitArray.toArtist",
                picasso,
View Full Code Here


            // without OUTER join we will get fewer objects...
            assertEquals(2, objects.size());

            Iterator it = objects.iterator();
            while (it.hasNext()) {
                Artist a = (Artist) it.next();
                List list = a.getPaintingArray();

                assertNotNull(list);
                assertFalse(((ValueHolder) list).isFault());
                assertTrue(list.size() > 0);
View Full Code Here

            assertEquals(3, objects.size());

            Iterator it = objects.iterator();
            while (it.hasNext()) {
                Painting p = (Painting) it.next();
                Artist target = p.getToArtist();
                assertNotNull(target);
                assertEquals(PersistenceState.COMMITTED, target.getPersistenceState());
            }
        }
        finally {
            unblockQueries();
        }
View Full Code Here

                assertEquals(1, objects.size());

                Iterator it = objects.iterator();
                while (it.hasNext()) {
                    Painting p = (Painting) it.next();
                    Artist a = p.getToArtist();
                    assertNotNull(a);
                    assertNotNull(a.getDateOfBirth());
                    assertTrue(a.getDateOfBirth().getClass().getName(), Date.class
                            .isAssignableFrom(a.getDateOfBirth().getClass()));
                }
            }
            finally {
                unblockQueries();
            }
View Full Code Here

        try {
            assertEquals(3, objects.size());

            Iterator it = objects.iterator();
            while (it.hasNext()) {
                Artist a = (Artist) it.next();
                List list = a.getPaintingArray();

                assertNotNull(list);
                assertFalse(((ValueHolder) list).isFault());

                Iterator children = list.iterator();
View Full Code Here

        try {

            assertEquals(1, objects.size());

            Artist a = (Artist) objects.get(0);
            List list = a.getPaintingArray();

            assertNotNull(list);
            assertFalse(((ValueHolder) list).isFault());
            assertEquals(2, list.size());
View Full Code Here

            assertEquals(3, objects.size());

            Iterator it = objects.iterator();
            while (it.hasNext()) {
                Artist a = (Artist) it.next();
                ValueHolder list = (ValueHolder) a.getPaintingArray();

                assertNotNull(list);

                // intermediate relationship is not fetched...
                assertTrue(list.isFault());
View Full Code Here

        deleteTestData();
        createTestData("testRefreshObjectToMany");

        DataContext context = createDataContext();

        Artist a = Cayenne.objectForPK(context, Artist.class, 33001l);
        assertEquals(2, a.getPaintingArray().size());

        createTestData("testRefreshObjectToManyUpdate");

        RefreshQuery refresh = new RefreshQuery(a);
        context.performQuery(refresh);
        assertEquals(PersistenceState.HOLLOW, a.getPersistenceState());
        assertEquals(1, a.getPaintingArray().size());
    }
View Full Code Here

        // fetch P1 separately from cached query
        Painting p1 = Cayenne.objectForPK(context, Painting.class, 33001);

        Painting p2 = (Painting) paints.get(0);
        Artist a1 = p2.getToArtist();
        assertSame(a1, p1.getToArtist());

        assertNotNull(context
                .getParentDataDomain()
                .getSharedSnapshotCache()
View Full Code Here

        // fetch P1 separately from cached query
        Painting p1 = Cayenne.objectForPK(context, Painting.class, 33001);

        Painting p2 = (Painting) paints.get(0);
        Artist a1 = p2.getToArtist();
        assertSame(a1, p1.getToArtist());

        assertNotNull(context
                .getParentDataDomain()
                .getSharedSnapshotCache()
View Full Code Here

TOP

Related Classes of org.apache.cayenne.testdo.testmap.Artist

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.