Package org.apache.torque.om

Examples of org.apache.torque.om.ObjectKey


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


     */
    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 testGetForeignKeyForDefaultedPrimitiveIntZero() throws Exception
    {
        PIntegerFkWithDefault pIntegerFk = new PIntegerFkWithDefault();
        pIntegerFk.setFk(0);
        ObjectKey foreignKey = pIntegerFk.getForeignKeyForPIntegerPk();
        assertNull(foreignKey.getValue());
    }
View Full Code Here

     *
     * @throws Exception if the test fails
     */
    public void testRetrieveByPk() throws Exception
    {
        ObjectKey primaryKey = authorList.get(1).getPrimaryKey();
        Author author = AuthorPeer.retrieveByPK(primaryKey);
        assertEquals("Expected author with Id "
                + authorList.get(1).getAuthorId()
                + " at first position but got "
                + author.getAuthorId(),
View Full Code Here

    public void testGetForeignKeyForDefaultedPrimitiveIntDefault()
            throws Exception
    {
        PIntegerFkWithDefault pIntegerFk = new PIntegerFkWithDefault();
        pIntegerFk.setFk(2);
        ObjectKey foreignKey = pIntegerFk.getForeignKeyForPIntegerPk();
        assertEquals(new NumberKey(2), foreignKey);
    }
View Full Code Here

     *
     * @throws Exception if the test fails
     */
    public void testRetrieveByNonExistingPk() throws Exception
    {
        ObjectKey primaryKey = new NumberKey(-1);
        try
        {
            AuthorPeer.retrieveByPK(primaryKey);
        }
        catch (NoRowsException e)
View Full Code Here

     */
    public void testGetForeignKeyForDefaultedPrimitiveIntNotZero() throws Exception
    {
        PIntegerFkWithDefault pIntegerFk = new PIntegerFkWithDefault();
        pIntegerFk.setFk(3);
        ObjectKey foreignKey = pIntegerFk.getForeignKeyForPIntegerPk();
        assertEquals(new NumberKey(3), foreignKey);
    }
View Full Code Here

     *
     * @throws Exception if the test fails
     */
    public void testRetrieveByNullValuePk() throws Exception
    {
        ObjectKey primaryKey = new NumberKey((BigDecimal) null);
        try
        {
            AuthorPeer.retrieveByPK(primaryKey);
        }
        catch (NoRowsException e)
View Full Code Here

     */
    public void testGetForeignKeyForObjectIntNull() throws Exception
    {
        NullableOIntegerFk nullableOIntegerFk = new NullableOIntegerFk();
        nullableOIntegerFk.setFk(null);
        ObjectKey foreignKey = nullableOIntegerFk.getForeignKeyForOIntegerPk();
        assertNull(foreignKey.getValue());
    }
View Full Code Here

     */
    public void testGetForeignKeyForObjectIntZero() throws Exception
    {
        NullableOIntegerFk nullableOIntegerFk = new NullableOIntegerFk();
        nullableOIntegerFk.setFk(0);
        ObjectKey foreignKey = nullableOIntegerFk.getForeignKeyForOIntegerPk();
        assertEquals(new NumberKey(0), foreignKey);
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.om.ObjectKey

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.