Examples of readPropertyDirectly()


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

                    }
                }
                assertTrue(names.contains("big"));
                assertTrue(names.contains("small"));

                List<Ball> balls = (List<Ball>) big.readPropertyDirectly(Box.BALLS_PROPERTY);
                assertNotNull(balls);
                assertFalse(((ValueHolder) balls).isFault());
                assertEquals(2, balls.size());
                List<Integer> volumes = new ArrayList<Integer>();
                for (Ball ball : balls) {
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.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.cayenne.testdo.testmap.Exhibit.readPropertyDirectly()

        // CAY-96 bug report)

        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.cayenne.testdo.testmap.Exhibit.readPropertyDirectly()

        DataRow snapshot = context.currentSnapshot(e);

        // assert that after taking a snapshot, we have FK in, but the relationship
        // is still a Fault
        assertTrue(e.readPropertyDirectly(Exhibit.TO_GALLERY_PROPERTY) instanceof Fault);
        assertEquals(new Integer(33002), snapshot.get("GALLERY_ID"));
    }

    /**
     * Tests how CHAR field is handled during fetch. Some databases (Oracle...) would pad
View Full Code Here

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

        // CAY-96 bug report)

        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.cayenne.testdo.testmap.Exhibit.readPropertyDirectly()

        DataRow snapshot = context.currentSnapshot(e);

        // assert that after taking a snapshot, we have FK in, but the relationship
        // is still a Fault
        assertTrue(e.readPropertyDirectly(Exhibit.TO_GALLERY_PROPERTY) instanceof Fault);
        assertEquals(new Integer(33002), snapshot.get("GALLERY_ID"));
    }

    /**
     * Tests how CHAR field is handled during fetch. Some databases (Oracle...) would pad
View Full Code Here

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

        assertEquals(1, galleries.size());

        Gallery g2 = galleries.get(0);

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

        Exhibit e1 = exhibits.get(0);
View Full Code Here

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

            public void execute() {
                assertEquals(2, results.size());

                // testing non-null to-one target
                Painting p0 = results.get(0);
                Object o2 = p0.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY);
                assertTrue(o2 instanceof PaintingInfo);
                PaintingInfo pi2 = (PaintingInfo) o2;
                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));
View Full Code Here

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

                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));

                // testing null to-one target
                Painting p1 = results.get(1);
                assertNull(p1.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY));

                // there was a bug marking an object as dirty when clearing the
                // relationships
                assertEquals(PersistenceState.COMMITTED, p1.getPersistenceState());
            }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.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
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.