Package org.apache.torque.test.dbobject

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


        // object already associated to another object
        fkList.add(testData.getCompositeIntegerVarcharFkList().get(0));
        // object not associated yet
        fkList.add(testData.getCompositeIntegerVarcharFkList().get(3));
        // new object
        CompIntegerVarcharFk newCompIntegerVarcharFk
                = new CompIntegerVarcharFk();
        newCompIntegerVarcharFk.setName("newCompositeIntegerVarcharFk");
        fkList.add(newCompIntegerVarcharFk);

        CompIntegerVarcharPkPeer.setAndSaveCompIntegerVarcharFks(
                    compIntegerVarcharPk,
                    fkList);

        List<CompIntegerVarcharFk> cachedFks
                = compIntegerVarcharPk.getCompIntegerVarcharFks();
        assertEquals(4, cachedFks.size());
        assertEquals(
                testData.getCompositeIntegerVarcharFkList().get(1).getId(),
                cachedFks.get(0).getId());
        assertEquals(
                compIntegerVarcharPk.getId1(),
                cachedFks.get(0).getFk1());
        assertEquals(
                compIntegerVarcharPk.getId2(),
                cachedFks.get(0).getFk2());
        assertEquals(
                testData.getCompositeIntegerVarcharFkList().get(1).getName(),
                cachedFks.get(0).getName());
        assertEquals(
                testData.getCompositeIntegerVarcharFkList().get(0).getId(),
                cachedFks.get(1).getId());
        assertEquals(
                compIntegerVarcharPk.getId1(),
                cachedFks.get(1).getFk1());
        assertEquals(
                compIntegerVarcharPk.getId2(),
                cachedFks.get(1).getFk2());
        assertEquals(
                testData.getCompositeIntegerVarcharFkList().get(0).getName(),
                cachedFks.get(1).getName());
        assertEquals(
                testData.getCompositeIntegerVarcharFkList().get(3).getId(),
                cachedFks.get(2).getId());
        assertEquals(
                compIntegerVarcharPk.getId1(),
                cachedFks.get(2).getFk1());
        assertEquals(
                compIntegerVarcharPk.getId2(),
                cachedFks.get(2).getFk2());
        assertEquals(
                testData.getCompositeIntegerVarcharFkList().get(3).getName(),
                cachedFks.get(2).getName());
        assertEquals(
                newCompIntegerVarcharFk.getId(),
                cachedFks.get(3).getId());
        assertEquals(
                compIntegerVarcharPk.getId1(),
                cachedFks.get(3).getFk1());
        assertEquals(
                compIntegerVarcharPk.getId2(),
                cachedFks.get(3).getFk2());
        assertEquals(
                newCompIntegerVarcharFk.getName(),
                cachedFks.get(3).getName());

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


    private static void fillCompositeIntegerVarcharFks(
                ForeignKeySchemaData result)
            throws TorqueException
    {
        CompIntegerVarcharFk compositeIntegerVarcharFk2
                = new CompIntegerVarcharFk();
        compositeIntegerVarcharFk2.setName(
                "compositeIntegerVarcharFk2");
        result.getCompositeIntegerVarcharPkList().get(1)
                .addCompIntegerVarcharFk(
                    compositeIntegerVarcharFk2);
        result.getCompositeIntegerVarcharFkList().add(
                compositeIntegerVarcharFk2);

        CompIntegerVarcharFk compositeIntegerVarcharFk3a
                = new CompIntegerVarcharFk();
        compositeIntegerVarcharFk3a.setName(
                "compositeIntegerVarcharFk3a");
        result.getCompositeIntegerVarcharPkList().get(2)
                .addCompIntegerVarcharFk(
                    compositeIntegerVarcharFk3a);
        result.getCompositeIntegerVarcharFkList().add(
                compositeIntegerVarcharFk3a);

        CompIntegerVarcharFk compositeIntegerVarcharFk3b
                = new CompIntegerVarcharFk();
        compositeIntegerVarcharFk3b.setName(
                "compositeIntegerVarcharFk3b");
        result.getCompositeIntegerVarcharPkList().get(2)
                .addCompIntegerVarcharFk(
                    compositeIntegerVarcharFk3b);
        result.getCompositeIntegerVarcharFkList().add(
                compositeIntegerVarcharFk3b);

        CompIntegerVarcharFk compositeIntegerVarcharFk4
                = new CompIntegerVarcharFk();
        compositeIntegerVarcharFk4.setName(
                "compositeIntegerVarcharFk4");
        result.getCompositeIntegerVarcharFkList().add(
                compositeIntegerVarcharFk4);
    }
View Full Code Here

TOP

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

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.