Examples of readPropertyDirectly()


Examples of org.apache.cayenne.testdo.relationship.FlattenedTest3.readPropertyDirectly()

        FlattenedTest3 ft3 = (FlattenedTest3) ft3s.get(0);

        // mark as dirty for the purpose of the test...
        ft3.setPersistenceState(PersistenceState.MODIFIED);

        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);

        // test that checking for modifications does not trigger a fault, and generally
        // works well

        ClassDescriptor d = context.getEntityResolver().getClassDescriptor(
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.FlattenedTest3.readPropertyDirectly()

                "FlattenedTest3");
        ArcProperty flattenedRel = (ArcProperty) d.getProperty("toFT1");

        ObjectDiff diff = context.getObjectStore().registerDiff(ft3.getObjectId(), null);
        assertFalse(DataRowUtils.isToOneTargetModified(flattenedRel, ft3, diff));
        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);
    }

}
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.FlattenedTest3.readPropertyDirectly()

        // fetch
        List ft3s = context.performQuery(new SelectQuery(FlattenedTest3.class));
        assertEquals(1, ft3s.size());
        FlattenedTest3 ft3 = (FlattenedTest3) ft3s.get(0);

        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);

        // test that taking a snapshot does not trigger a fault, and generally works well
        Map snapshot = context.currentSnapshot(ft3);

        assertEquals("ft3", snapshot.get("NAME"));
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.FlattenedTest3.readPropertyDirectly()

        // test that taking a snapshot does not trigger a fault, and generally works well
        Map snapshot = context.currentSnapshot(ft3);

        assertEquals("ft3", snapshot.get("NAME"));
        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);

    }

    public void testRefetchWithFlattenedFaultToOneTarget1() throws Exception {
        createTestData("test");
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.FlattenedTest3.readPropertyDirectly()

        // fetch
        List ft3s = context.performQuery(new SelectQuery(FlattenedTest3.class));
        assertEquals(1, ft3s.size());
        FlattenedTest3 ft3 = (FlattenedTest3) ft3s.get(0);

        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);

        // refetch
        context.performQuery(new SelectQuery(FlattenedTest3.class));
        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.FlattenedTest3.readPropertyDirectly()

        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);

        // refetch
        context.performQuery(new SelectQuery(FlattenedTest3.class));
        assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);
    }

    public void testFlattenedCircular() throws Exception {
        createTestData("testFlattenedCircular");
        context = createDataContext();
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.ToOneFK2.readPropertyDirectly()

                src.getObjectId(),
                false,
                ObjectIdQuery.CACHE_REFRESH);
        ToOneFK2 src2 = (ToOneFK2) Cayenne.objectForQuery(context, refetch);

        assertTrue(src2.readPropertyDirectly("toOneToFK") instanceof Fault);

        // test that taking a snapshot does not trigger a fault, and generally works well
        context.currentSnapshot(src2);
        assertTrue(src2.readPropertyDirectly("toOneToFK") instanceof Fault);
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.ToOneFK2.readPropertyDirectly()

        assertTrue(src2.readPropertyDirectly("toOneToFK") instanceof Fault);

        // test that taking a snapshot does not trigger a fault, and generally works well
        context.currentSnapshot(src2);
        assertTrue(src2.readPropertyDirectly("toOneToFK") instanceof Fault);
    }

    public void testDelete() throws Exception {
        ToOneFK2 src = context.newObject(ToOneFK2.class);
        ToOneFK1 target = context.newObject(ToOneFK1.class);
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.readPropertyDirectly()

        Painting painting = (Painting) context.performQuery(
                new SelectQuery(Painting.class)).get(0);
        final Artist artist = painting.getToArtist();
        assertEquals(PersistenceState.HOLLOW, artist.getPersistenceState());
        assertNull(artist.readPropertyDirectly("artistName"));

        int queries = queryInterceptor.runWithQueryCounter(new UnitTestClosure() {

            public void execute() {
                // this must trigger a fetch
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.Artist.readPropertyDirectly()

        });

        assertEquals(1, queries);

        assertEquals(PersistenceState.MODIFIED, artist.getPersistenceState());
        assertNotNull(artist.readPropertyDirectly("artistName"));
    }
}
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.