Package org.jpox.store.mapped.expression

Examples of org.jpox.store.mapped.expression.IntegerLiteral


    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        if (datastoreJavaType.equals(ClassNameConstants.JAVA_LANG_INTEGER))
        {
            // Return an IntegerLiteral to represent this Enum, but with the original value present just in case
            ScalarExpression expr = new IntegerLiteral(qs, this, BigInteger.valueOf(((Enum)value).ordinal()));
            ((Literal)expr).setRawValue(value);
            return expr;
        }
        else if (datastoreJavaType.equals(ClassNameConstants.JAVA_LANG_STRING))
        {
View Full Code Here


        return mappingSampleValue;
    }

    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        ScalarExpression expr = new IntegerLiteral(qs, this, (Number)value);
        return expr;
    }
View Full Code Here

        return mappingSampleValue;
    }

    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        ScalarExpression expr = new IntegerLiteral(qs, this, (Number)value);
        return expr;
    }
View Full Code Here

     * @param value The value of the literal
     * @return The Literal
     */
    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        return new IntegerLiteral(qs, this, objectToNumber(value));
    }
View Full Code Here

     * @param value The value of the object
     * @return The new literal
     */
    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        return new IntegerLiteral(qs, this, (Number)value);
    }
View Full Code Here

        return mappingSampleValue;
    }

    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        ScalarExpression expr = new IntegerLiteral(qs, this, (Number)value);
        return expr;       
    }
View Full Code Here

     * @param value The value of the literal
     * @return The Literal
     */
    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        return new IntegerLiteral(qs, this, objectToLong(value));
    }
View Full Code Here

    return mappingSampleValue;
  }
 
    public ScalarExpression newLiteral(QueryExpression qs, Object value)
    {
        ScalarExpression expr = new IntegerLiteral(qs, this, (Number)value);
        return expr;
    }
View Full Code Here

                            }
                            else if (methodId.equalsIgnoreCase("SUBSTRING"))
                            {
                                List argscall = new ArrayList();
                                JavaTypeMapping mapping = srm.getDatastoreAdapter().getMapping(String.class, srm);
                                IntegerLiteral one = new IntegerLiteral(qs, mapping, BigInteger.ONE, false);
                                argscall.add(((ScalarExpression) args.get(1)).sub(one));
                                if (args.size() > 2)
                                {
                                    argscall.add(((ScalarExpression) args.get(2)).add(one));
                                }
                                return ((ScalarExpression) args.get(0)).callMethod(methodId.toLowerCase(), argscall);
                            }
                            else if (methodId.equalsIgnoreCase("LOWER"))
                            {
                                return ((ScalarExpression) args.get(0)).callMethod("toLowerCase",
                                    Collections.EMPTY_LIST);
                            }
                            else if (methodId.equalsIgnoreCase("UPPER"))
                            {
                                return ((ScalarExpression) args.get(0)).callMethod("toUpperCase",
                                    Collections.EMPTY_LIST);
                            }
                            else if (methodId.equalsIgnoreCase("SIZE"))
                            {
                                return ((ScalarExpression) args.get(0)).callMethod(methodId.toLowerCase(),
                                    Collections.EMPTY_LIST);
                            }
                            else if (methodId.equalsIgnoreCase("LOCATE"))
                            {
                                List argscall = new ArrayList();
                                argscall.add(args.get(0));
                                JavaTypeMapping mapping = srm.getDatastoreAdapter().getMapping(String.class, srm);
                                IntegerLiteral one = new IntegerLiteral(qs, mapping, BigInteger.ONE,false);
                                if (args.size() > 2)
                                {
                                    argscall.add(((ScalarExpression)args.get(2)).sub(one));
                                }
                                return ((ScalarExpression)args.get(1)).callMethod("indexOf", argscall).add(one);
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.expression.IntegerLiteral

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.