Examples of ToOneFK2


Examples of org.apache.cayenne.testdo.relationship.ToOneFK2

        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);
        src.setToOneToFK(target);
        context.commitChanges();

        src.setToOneToFK(null);
        context.deleteObjects(target);
        context.commitChanges();

        // test database data

        ObjectIdQuery refetch = new ObjectIdQuery(
                src.getObjectId(),
                false,
                ObjectIdQuery.CACHE_REFRESH);
        ToOneFK2 src2 = (ToOneFK2) Cayenne.objectForQuery(context1, refetch);
        assertNull(src.getToOneToFK());
        assertEquals(src.getObjectId(), src2.getObjectId());
    }
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.