Package org.apache.torque.test.dbobject

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


     *
     * @throws Exception if a database error occurs.
     */
    public void testGetForeignKeyForPrimitiveIntZero() throws Exception
    {
        NullablePIntegerFk nullablePIntegerFk = new NullablePIntegerFk();
        nullablePIntegerFk.setFk(0);
        ObjectKey foreignKey = nullablePIntegerFk.getForeignKeyForPIntegerPk();
        assertNull(foreignKey.getValue());
    }
View Full Code Here


     *
     * @throws Exception if a database error occurs.
     */
    public void testGetForeignKeyForPrimitiveIntNotZero() throws Exception
    {
        NullablePIntegerFk nullablePIntegerFk = new NullablePIntegerFk();
        nullablePIntegerFk.setFk(3);
        ObjectKey foreignKey = nullablePIntegerFk.getForeignKeyForPIntegerPk();
        assertEquals(new NumberKey(3), foreignKey);
    }
View Full Code Here

     */
    public void testAddPrimitiveIntFkZero() throws Exception
    {
        // prepare
        PIntegerPk pIntegerPk = new PIntegerPk();
        NullablePIntegerFk nullablePIntegerFk = new NullablePIntegerFk();

        // execute
        pIntegerPk.addNullablePIntegerFk(nullablePIntegerFk);

        // verify
        assertEquals(1, pIntegerPk.getNullablePIntegerFks().size());
        assertSame(
                nullablePIntegerFk,
                pIntegerPk.getNullablePIntegerFks().get(0));

        assertEquals(0, nullablePIntegerFk.getFk());
        assertSame(pIntegerPk, nullablePIntegerFk.getPIntegerPk());
    }
View Full Code Here

    public void testAddPrimitiveIntFkNonZero() throws Exception
    {
        // prepare
        PIntegerPk pIntegerPk = new PIntegerPk();
        pIntegerPk.setId(23);
        NullablePIntegerFk nullablePIntegerFk = new NullablePIntegerFk();

        // execute
        pIntegerPk.addNullablePIntegerFk(nullablePIntegerFk);

        // verify
        assertEquals(1, pIntegerPk.getNullablePIntegerFks().size());
        assertSame(
                nullablePIntegerFk,
                pIntegerPk.getNullablePIntegerFks().get(0));

        assertEquals(23, nullablePIntegerFk.getFk());
        assertSame(pIntegerPk, nullablePIntegerFk.getPIntegerPk());
    }
View Full Code Here

    }

    private static void fillNullablePIntegerPks(ForeignKeySchemaData result)
            throws TorqueException
    {
        NullablePIntegerFk nullablePIntegerFk2
                = new NullablePIntegerFk();
        nullablePIntegerFk2.setName(
                "nullablePIntegerFk2");
        result.getPIntegerPkList().get(1).addNullablePIntegerFk(
                nullablePIntegerFk2);
        result.getNullablePIntegerFkList().add(
                nullablePIntegerFk2);

        NullablePIntegerFk nullablePIntegerFk3a
                = new NullablePIntegerFk();
        nullablePIntegerFk3a.setName(
                "nullablePIntegerFk3a");
        result.getPIntegerPkList().get(2).addNullablePIntegerFk(
                nullablePIntegerFk3a);
        result.getNullablePIntegerFkList().add(
                nullablePIntegerFk3a);

        NullablePIntegerFk nullablePIntegerFk3b
                = new NullablePIntegerFk();
        nullablePIntegerFk3b.setName(
                "nullablePIntegerFk3b");
        result.getPIntegerPkList().get(2).addNullablePIntegerFk(
                nullablePIntegerFk3b);
        result.getNullablePIntegerFkList().add(
                nullablePIntegerFk3b);
View Full Code Here

TOP

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

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.