Package org.apache.cayenne.testdo.relationship

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

Related Classes of org.apache.cayenne.testdo.relationship.ToOneFK2

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.