Examples of readPropertyDirectly()


Examples of org.apache.art.Artist.readPropertyDirectly()

        // needed
        ThreadedTestHelper helper = new ThreadedTestHelper() {

            @Override
            protected void assertResult() throws Exception {
                Object value = altArtist.readPropertyDirectly("paintingArray");
                assertTrue("Unexpected: " + value, value instanceof ToManyList);
                assertTrue(((ToManyList) value).isFault());
            }
        };
        helper.assertWithTimeout(2000);
View Full Code Here

Examples of org.apache.art.BinaryPKTest2.readPropertyDirectly()

        // create new context
        context = createDataContext();
        BinaryPKTest2 fetchedDetail = (BinaryPKTest2) context.performQuery(
                new SelectQuery(BinaryPKTest2.class)).get(0);

        assertNotNull(fetchedDetail.readPropertyDirectly("toBinaryPKMaster"));

        BinaryPKTest1 fetchedMaster = fetchedDetail.getToBinaryPKMaster();
        assertNotNull(fetchedMaster);
        assertEquals(PersistenceState.HOLLOW, fetchedMaster.getPersistenceState());
        assertEquals("master1", fetchedMaster.getName());
View Full Code Here

Examples of org.apache.art.CharPkTestEntity.readPropertyDirectly()

        List pks = context.performQuery(q);
        assertEquals(2, pks.size());

        CharPkTestEntity pk1 = (CharPkTestEntity) pks.get(0);
        assertEquals("n1", pk1.getOtherCol());
        List toMany = (List) pk1.readPropertyDirectly("charFKs");
        assertNotNull(toMany);
        assertFalse(((ValueHolder)toMany).isFault());
        assertEquals(3, toMany.size());

        CharFkTestEntity fk1 = (CharFkTestEntity) toMany.get(0);
View Full Code Here

Examples of org.apache.art.Exhibit.readPropertyDirectly()

        populateExhibits();

        ObjectId eId = new ObjectId("Exhibit", Exhibit.EXHIBIT_ID_PK_COLUMN, 2);
        Exhibit e = (Exhibit) context.performQuery(new ObjectIdQuery(eId)).get(0);

        assertTrue(e.readPropertyDirectly(Exhibit.TO_GALLERY_PROPERTY) instanceof Fault);

        DataRow snapshot = context.currentSnapshot(e);

        // assert that after taking a snapshot, we have FK in, but the relationship
        // is still a Fault
View Full Code Here

Examples of org.apache.art.Gallery.readPropertyDirectly()

        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.Painting.readPropertyDirectly()

        // make sure toOne relationships from Paintings
        // are resolved...
        altPainting1.getToArtist();
        altPainting2.getToArtist();
        assertSame(altArtist, altPainting1.readPropertyDirectly("toArtist"));
        assertSame(altArtist, altPainting2.readPropertyDirectly("toArtist"));

        // delete painting
        context.deleteObject(painting1);
        context.commitChanges();
View Full Code Here

Examples of org.apache.cayenne.CayenneDataObject.readPropertyDirectly()

        List pks = context.performQuery(q);
        assertEquals(1, pks.size());
        CayenneDataObject pk1 = (CayenneDataObject) pks.get(0);

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

        CayenneDataObject fk1 = (CayenneDataObject) toMany.get(0);
View Full Code Here

Examples of org.apache.cayenne.DataObject.readPropertyDirectly()

                    "Expected DataObject, got: " + toOnePrefetch.getClass().getName(),
                    toOnePrefetch instanceof DataObject);

            DataObject pk1 = (DataObject) toOnePrefetch;
            assertEquals(PersistenceState.COMMITTED, pk1.getPersistenceState());
            assertEquals("CPK2", pk1.readPropertyDirectly("name"));
        }
        finally {
            unblockQueries();
        }
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.db.UuidRoot1.readPropertyDirectly()

                .getEntityResolver());
        UuidRelationshipHandler handler = new UuidRelationshipHandler(refHandler);
        handler.relate(r1, e1);

        assertEquals("E1:1", r1.getUuid());
        assertSame(e1, r1.readPropertyDirectly("cay:related:uuid"));

        context.commitChanges();

        Object[] r1x = rootTable.select();
        assertEquals("E1:1", r1x[1]);
View Full Code Here

Examples of org.apache.cayenne.lifecycle.db.UuidRoot1.readPropertyDirectly()

        ReferenceableHandler refHandler = new ReferenceableHandler(context
                .getEntityResolver());
        UuidRelationshipHandler handler = new UuidRelationshipHandler(refHandler);
        handler.relate(r1, e1);

        assertSame(e1, r1.readPropertyDirectly("cay:related:uuid"));

        context.commitChanges();

        int id = Cayenne.intPKForObject(e1);
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.