Package org.apache.torque.om

Examples of org.apache.torque.om.NumberKey


        try
        {
            TurbineGroup tgroup = new TurbineGroup();
            tgroup.setGroupName(group.getName());
            Criteria criteria = TurbineGroupPeer.buildCriteria(tgroup);
            NumberKey key = (NumberKey)TurbineGroupPeer.doInsert(criteria);
            group.setId(key.toString());
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to create group '" +
                group.getName() + "'", e);
View Full Code Here


        try
        {
            TurbineRole trole = new TurbineRole();
            trole.setRoleName(role.getName());
            Criteria criteria = TurbineRolePeer.buildCriteria(trole);
            NumberKey key = (NumberKey)TurbineRolePeer.doInsert(criteria);
            role.setId(key.toString());
        }
        catch(Exception e)
        {
            throw new RoleException("Failed to create role '" +
                role.getName() + "'", e);
View Full Code Here

            Object object = parameters.get(convert(name));
            if (object != null)
            {
                value = ((String[])object)[0];
            }
            return (StringUtils.isValid(value) ? new NumberKey(value) : null);
        }
        catch ( ClassCastException e )
        {
            return null;
        }
View Full Code Here

        if(prop == null)
            return;

        try
        {
            defaultValue = new NumberKey(prop);
        }
        catch(RuntimeException e)
        {
            Log.error("Could not convert "+prop+" into a NumberKey. ("+name+")");
        }
View Full Code Here

        {
            String[] ss = pp.getStrings(getKey());
            NumberKey[] ival = new NumberKey[ss.length];
            for (int i=0; i<ss.length; i++)
            {
                ival[i] = new NumberKey(ss[i]);
            }
            setTestValue(ival);
        }
        else
        {
            setTestValue( new NumberKey(pp.getString(getKey())) );
        }
    }
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[])row.getValue(objectDataPosition).asBytes();
View Full Code Here

        Constraint constraint = (Constraint)paramMap.get("minValue");
        if ( constraint != null )
        {
            String param = constraint.getValue();
            minValue = new NumberKey(param);
            minValueMessage = constraint.getMessage();
        }

        constraint = (Constraint)paramMap.get("maxValue");
        if ( constraint != null )
        {
            String param = constraint.getValue();
            maxValue = new NumberKey(param);
            maxValueMessage = constraint.getMessage();
        }
    }
View Full Code Here

     * testValue did not pass the validation tests.
     */
    protected void doAssertValidity(String testValue)
        throws ValidationException
    {
        NumberKey nk = null;
        try
        {
            nk = new NumberKey(testValue);
        }
        catch (RuntimeException e)
        {
            message = invalidNumberMessage;
            throw new ValidationException(invalidNumberMessage);
        }
        if ( minValue != null && nk.compareTo(minValue) < 0 )
        {
            message = minValueMessage;
            throw new ValidationException(minValueMessage);
        }
        if ( maxValue != null && nk.compareTo(maxValue) > 0 )
        {
            message = maxValueMessage;
            throw new ValidationException(maxValueMessage);
        }
    }
View Full Code Here

            .add(JobEntryPeer.DAY_OF_MONTH, getDay_of_month())
            .add(JobEntryPeer.TASK, getTask())
            .add(JobEntryPeer.EMAIL, getEmail())
            .add(JobEntryPeer.PROPERTY, getProperty());

        NumberKey nk = (NumberKey)getPrimaryKey();
        long key = 0;
        if (nk != null)
        {
            key = ((NumberKey)getPrimaryKey()).getBigDecimal().longValue();
        }
View Full Code Here

                                   -1,
                                   -1,
                                   -1,
                                   -1,
                                   null);
        je.setPrimaryKey((ObjectKey) new NumberKey(oid));
        return scheduleQueue.getJob(je);
    }
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.