Package org.apache.torque.om

Examples of org.apache.torque.om.NumberKey


    public void testGetForeignKeyForDefaultedObjectIntDefault() throws Exception
    {
        OIntegerFkWithDefault oIntegerFk = new OIntegerFkWithDefault();
        oIntegerFk.setFk(2);
        ObjectKey foreignKey = oIntegerFk.getForeignKeyForOIntegerPk();
        assertEquals(new NumberKey(2), foreignKey);
    }
View Full Code Here


    public void testGetForeignKeyForDefaultedObjectIntNotZero() throws Exception
    {
        OIntegerFkWithDefault oIntegerFk = new OIntegerFkWithDefault();
        oIntegerFk.setFk(3);
        ObjectKey foreignKey = oIntegerFk.getForeignKeyForOIntegerPk();
        assertEquals(new NumberKey(3), 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

     *
     * @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

        if (pk != null && keyGen != null)
        {
            if (pk.getType() instanceof Number)
            {
                id = new NumberKey(
                        keyGen.getIdAsBigDecimal(con, keyInfo));
            }
            else
            {
                id = new StringKey(keyGen.getIdAsString(con, keyInfo));
View Full Code Here

    public void testObjectKey() throws Exception
    {
        Criteria criteria = new Criteria();
        criteria.addSelectColumn(new ColumnImpl("table.column"));
        criteria.where(new ColumnImpl("column"), new NumberKey(11));
        Query query = SqlBuilder.buildQuery(criteria);
        assertEquals("SELECT table.column FROM table "
                + "WHERE column=?",
            query.toString());
        assertEquals(1, query.getPreparedStatementReplacements().size());
View Full Code Here

    public void testCriterionObjectKey() throws Exception
    {
        Criteria criteria = new Criteria();
        criteria.addSelectColumn("table.column");
        criteria.add("column", new NumberKey(11));
        Query query = SqlBuilder.buildQuery(criteria);
        assertEquals("SELECT table.column FROM table "
                + "WHERE column=?",
            query.toString());
        assertEquals(1, query.getPreparedStatementReplacements().size());
View Full Code Here

                    objectDataPosition = i + 1;
                }
            }

            ((Persistent) obj).setPrimaryKey(
                new NumberKey(row.getValue(idPosition).asBigDecimal()));

            // Restore the Permanent Storage Hashtable.  First the
            // Hashtable is restored, then any explicit table columns
            // which should be included in the Hashtable are added.
            byte[] objectData = (byte[])
View Full Code Here

            for (int i = 0; i < rows.size(); i++)
            {
                Permission obj = TurbineSecurity.getPermissionInstance(null);
                Record row = (Record) rows.get(i);
                ((SecurityObject) obj).setPrimaryKey(
                        new NumberKey(row.getValue(1).asInt()));
                ((SecurityObject) obj).setName(row.getValue(2).asString());
                byte[] objectData = (byte[]) row.getValue(3).asBytes();
                Map temp = (Map) ObjectUtils.deserialize(objectData);
                if (temp != null)
                {
View Full Code Here

            {
                //Role obj = new Role();
                Role obj = new TurbineRole();
                Record row = (Record) rows.get(i);
                ((TurbineRole) obj).setPrimaryKey(
                        new NumberKey(row.getValue(1).asInt()));
                ((TurbineRole) obj).setName(row.getValue(2).asString());
                byte[] objectData = (byte[]) row.getValue(3).asBytes();
                Map temp = (Map) ObjectUtils.deserialize(objectData);
                if (temp != null)
                {
View Full Code Here

TOP

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

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.