Examples of BinaryPKTest1


Examples of org.apache.art.BinaryPKTest1

    public void testInsertBinaryPK() throws Exception {
        if (!getAccessStackAdapter().supportsBinaryPK()) {
            return;
        }

        BinaryPKTest1 master = (BinaryPKTest1) context.newObject("BinaryPKTest1");
        master.setName("master1");

        BinaryPKTest2 detail = (BinaryPKTest2) context.newObject("BinaryPKTest2");
        detail.setDetailName("detail2");

        master.addToBinaryPKDetails(detail);

        context.commitChanges();

    }
View Full Code Here

Examples of org.apache.art.BinaryPKTest1

    public void testFetchRelationshipBinaryPK() throws Exception {
        if (!getAccessStackAdapter().supportsBinaryPK()) {
            return;
        }

        BinaryPKTest1 master = (BinaryPKTest1) context.newObject("BinaryPKTest1");
        master.setName("master1");

        BinaryPKTest2 detail = (BinaryPKTest2) context.newObject("BinaryPKTest2");
        detail.setDetailName("detail2");

        master.addToBinaryPKDetails(detail);

        context.commitChanges();

        // 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.cayenne.testdo.testmap.BinaryPKTest1

    public void testInsertBinaryPK() throws Exception {
        if (!getAccessStackAdapter().supportsBinaryPK()) {
            return;
        }

        BinaryPKTest1 master = (BinaryPKTest1) context.newObject("BinaryPKTest1");
        master.setName("master1");

        BinaryPKTest2 detail = (BinaryPKTest2) context.newObject("BinaryPKTest2");
        detail.setDetailName("detail2");

        master.addToBinaryPKDetails(detail);

        context.commitChanges();

    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.BinaryPKTest1

    public void testFetchRelationshipBinaryPK() throws Exception {
        if (!getAccessStackAdapter().supportsBinaryPK()) {
            return;
        }

        BinaryPKTest1 master = (BinaryPKTest1) context.newObject("BinaryPKTest1");
        master.setName("master1");

        BinaryPKTest2 detail = (BinaryPKTest2) context.newObject("BinaryPKTest2");
        detail.setDetailName("detail2");

        master.addToBinaryPKDetails(detail);

        context.commitChanges();

        // 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.cayenne.testdo.testmap.BinaryPKTest1

    }

    public void testInsertBinaryPK() throws Exception {
        if (accessStackAdapter.supportsBinaryPK()) {

            BinaryPKTest1 master = (BinaryPKTest1) context.newObject("BinaryPKTest1");
            master.setName("master1");

            BinaryPKTest2 detail = (BinaryPKTest2) context.newObject("BinaryPKTest2");
            detail.setDetailName("detail2");

            master.addToBinaryPKDetails(detail);

            context.commitChanges();
        }
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.BinaryPKTest1

    }

    public void testFetchRelationshipBinaryPK() throws Exception {
        if (accessStackAdapter.supportsBinaryPK()) {

            BinaryPKTest1 master = (BinaryPKTest1) context.newObject("BinaryPKTest1");
            master.setName("master1");

            BinaryPKTest2 detail = (BinaryPKTest2) context.newObject("BinaryPKTest2");
            detail.setDetailName("detail2");

            master.addToBinaryPKDetails(detail);

            context.commitChanges();
            context.invalidateObjects(master, detail);

            BinaryPKTest2 fetchedDetail = (BinaryPKTest2) context1.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
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.