Package org.apache.torque.test.dbobject

Examples of org.apache.torque.test.dbobject.NonPkOIntegerFk


        // object already associated to another object
        fkList.add(testData.getNonPkOIntegerFkList().get(2));
        // object not associated yet
        fkList.add(testData.getNonPkOIntegerFkList().get(3));
        // new object
        NonPkOIntegerFk newNonPkOIntegerFk = new NonPkOIntegerFk();
        newNonPkOIntegerFk.setName("newNonPkOIntegerFk");
        fkList.add(newNonPkOIntegerFk);

        OIntegerPkPeer.setAndSaveNonPkOIntegerFks(
                oIntegerPk,
                fkList);

        List<NonPkOIntegerFk> cachedFks
                = oIntegerPk.getNonPkOIntegerFks();
        assertEquals(4, cachedFks.size());
        assertEquals(
                testData.getNonPkOIntegerFkList().get(1).getId(),
                cachedFks.get(0).getId());
        assertEquals(
                oIntegerPk.getIntegerColumn(),
                cachedFks.get(0).getFk());
        assertEquals(
                testData.getNonPkOIntegerFkList().get(1).getName(),
                cachedFks.get(0).getName());
        assertEquals(
                testData.getNonPkOIntegerFkList().get(2).getId(),
                cachedFks.get(1).getId());
        assertEquals(
                oIntegerPk.getIntegerColumn(),
                cachedFks.get(1).getFk());
        assertEquals(
                testData.getNonPkOIntegerFkList().get(2).getName(),
                cachedFks.get(1).getName());
        assertEquals(
                testData.getNonPkOIntegerFkList().get(3).getId(),
                cachedFks.get(2).getId());
        assertEquals(
                oIntegerPk.getIntegerColumn(),
                cachedFks.get(2).getFk());
        assertEquals(
                testData.getNonPkOIntegerFkList().get(3).getName(),
                cachedFks.get(2).getName());
        assertEquals(
                newNonPkOIntegerFk.getId(),
                cachedFks.get(3).getId());
        assertEquals(
                oIntegerPk.getIntegerColumn(),
                cachedFks.get(3).getFk());
        assertEquals(
                newNonPkOIntegerFk.getName(),
                cachedFks.get(3).getName());

        // check database
        ForeignKeySchemaData.assertNonPkOIntegerFksInDatabaseEquals(
                cachedFks);
View Full Code Here


    }

    private static void fillNonPkOIntegerFks(ForeignKeySchemaData result)
            throws TorqueException
    {
        NonPkOIntegerFk nonPkOIntegerFk1a
                = new NonPkOIntegerFk();
        nonPkOIntegerFk1a.setName(
                "nonPkOIntegerFk1a");
        result.getOIntegerPkList().get(0).addNonPkOIntegerFk(
                nonPkOIntegerFk1a);
        result.getNonPkOIntegerFkList().add(
                nonPkOIntegerFk1a);

        NonPkOIntegerFk nonPkOIntegerFk1b
                = new NonPkOIntegerFk();
        nonPkOIntegerFk1b.setName(
                "nonPkOIntegerFk1b");
        result.getOIntegerPkList().get(0).addNonPkOIntegerFk(
                nonPkOIntegerFk1b);
        result.getNonPkOIntegerFkList().add(
                nonPkOIntegerFk1b);

        NonPkOIntegerFk nonPkOIntegerFk2
                = new NonPkOIntegerFk();
        nonPkOIntegerFk2.setName(
                "nonPkOIntegerFk2");
        result.getOIntegerPkList().get(1).addNonPkOIntegerFk(
                nonPkOIntegerFk2);
        result.getNonPkOIntegerFkList().add(
                nonPkOIntegerFk2);

        NonPkOIntegerFk nonPkOIntegerFk4
                = new NonPkOIntegerFk();
        nonPkOIntegerFk4.setName(
                "nonPkOIntegerFk4");
        result.getNonPkOIntegerFkList().add(
                nonPkOIntegerFk4);
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.test.dbobject.NonPkOIntegerFk

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.