Package org.apache.turbine.om

Examples of org.apache.turbine.om.StringKey


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


                    id = new NumberKey( tableMap.getIdGenerator()
                        .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
                }
                else
                {
                    id = new StringKey( tableMap.getIdGenerator()
                        .getIdAsString(dbCon.getConnection(), keyInfo) );
                }
                criteria.add( pk.getFullyQualifiedName(), id );
            }
        }

        // Set up Village for the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(dbCon.getConnection(), tableName );
            Record rec = tds.addRecord();
            insertOrUpdateRecord(rec, tableName, criteria);
        }
        finally
        {
            if (tds != null) tds.close();
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if ((keyGen != null) && (keyGen.isPostInsert()))
        {
            if ( pk.getType() instanceof Number )
            {
                id = new NumberKey( tableMap.getIdGenerator()
                    .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
            }
            else
            {
                id = new StringKey( tableMap.getIdGenerator()
                    .getIdAsString(dbCon.getConnection(), keyInfo) );
            }
        }

        return id;
View Full Code Here

                    id = new NumberKey( tableMap.getIdGenerator()
                        .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
                }
                else
                {
                    id = new StringKey( tableMap.getIdGenerator()
                        .getIdAsString(dbCon.getConnection(), keyInfo) );
                }
                criteria.add( pk.getFullyQualifiedName(), id );
            }
        }

        // Set up Village for the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(dbCon.getConnection(), tableName );
            Record rec = tds.addRecord();
            insertOrUpdateRecord(rec, tableName, criteria);
        }
        finally
        {
            if (tds != null) tds.close();
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if ((keyGen != null) && (keyGen.isPostInsert()))
        {
            if ( pk.getType() instanceof Number )
            {
                id = new NumberKey( tableMap.getIdGenerator()
                    .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
            }
            else
            {
                id = new StringKey( tableMap.getIdGenerator()
                    .getIdAsString(dbCon.getConnection(), keyInfo) );
            }
        }

        return id;
View Full Code Here

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

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

                    id = new NumberKey( tableMap.getIdGenerator()
                        .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
                }
                else
                {
                    id = new StringKey( tableMap.getIdGenerator()
                        .getIdAsString(dbCon.getConnection(), keyInfo) );
                }
                criteria.add( pk.getFullyQualifiedName(), id );
            }
        }

        // Set up Village for the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(dbCon.getConnection(), tableName );
            Record rec = tds.addRecord();
            insertOrUpdateRecord(rec, tableName, criteria);
        }
        finally
        {
            if (tds != null) tds.close();
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if ((keyGen != null) && (keyGen.isPostInsert()))
        {
            if ( pk.getType() instanceof Number )
            {
                id = new NumberKey( tableMap.getIdGenerator()
                    .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
            }
            else
            {
                id = new StringKey( tableMap.getIdGenerator()
                    .getIdAsString(dbCon.getConnection(), keyInfo) );
            }
        }

        return id;
View Full Code Here

     * Sets the default value for an StringKeyField
     */
   
    protected void setDefaultValue(String prop)
    {
        defaultValue = new StringKey(prop);
    }
View Full Code Here

        {
            String[] ss = pp.getStrings(getKey());
            StringKey[] ival = new StringKey[ss.length];
            for (int i=0; i<ss.length; i++)
            {
                ival[i] = new StringKey(ss[i]);
            }
            setTestValue(ival);
        }
        else
        {
            setTestValue( new StringKey(pp.getString(getKey())) );
        }
    }
View Full Code Here

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

                    id = new NumberKey( tableMap.getIdGenerator()
                        .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
                }
                else
                {
                    id = new StringKey( tableMap.getIdGenerator()
                        .getIdAsString(dbCon.getConnection(), keyInfo) );
                }
                criteria.add( pk.getFullyQualifiedName(), id );
            }
        }

        // Set up Village for the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(dbCon.getConnection(), tableName );
            Record rec = tds.addRecord();
            insertOrUpdateRecord(rec, tableName, criteria);
        }
        finally
        {
            if (tds != null) tds.close();
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if ((keyGen != null) && (keyGen.isPostInsert()))
        {
            if ( pk.getType() instanceof Number )
            {
                id = new NumberKey( tableMap.getIdGenerator()
                    .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
            }
            else
            {
                id = new StringKey( tableMap.getIdGenerator()
                    .getIdAsString(dbCon.getConnection(), keyInfo) );
            }
        }

        return id;
View Full Code Here

TOP

Related Classes of org.apache.turbine.om.StringKey

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.