Package org.datanucleus.store.rdbms.sql.expression

Examples of org.datanucleus.store.rdbms.sql.expression.SQLLiteral


                else
                {
                    // Create Literal for the parameter (since we need to perform operations on it)
                    processParameterExpression(paramExpr, true);
                    SQLExpression paramSqlExpr = stack.pop();
                    SQLLiteral lit = (SQLLiteral)paramSqlExpr;
                    Object paramValue = lit.getValue();

                    List<String> tuples = expr.getTuples();
                    Iterator<String> tuplesIter = tuples.iterator();
                    Object objValue = paramValue;
                    while (tuplesIter.hasNext())
View Full Code Here


                // SQLExpression numExpr = (SQLExpression)args.get(1);
                // TODO Use numExpr in a SUBSTRING
                if (substrExpr.isParameter())
                {
                    // Any pattern expression cannot be a parameter here
                    SQLLiteral substrLit = (SQLLiteral)substrExpr;
                    stmt.getQueryGenerator().useParameterExpressionAsLiteral(substrLit);
                    if (substrLit.getValue() == null)
                    {
                        return new BooleanExpression(expr, Expression.OP_LIKE,
                            ExpressionUtils.getEscapedPatternExpression(substrExpr));
                    }
                }
                SQLExpression likeSubstrExpr = new StringLiteral(stmt,
                    expr.getJavaTypeMapping(), '%', null);
                return new BooleanExpression(expr, Expression.OP_LIKE,
                    likeSubstrExpr.add(ExpressionUtils.getEscapedPatternExpression(substrExpr)));
            }
            else
            {
                // Create a new StringExpression and manually update its SQL
                if (substrExpr.isParameter())
                {
                    // Any pattern expression cannot be a parameter here
                    SQLLiteral substrLit = (SQLLiteral)substrExpr;
                    stmt.getQueryGenerator().useParameterExpressionAsLiteral(substrLit);
                    if (substrLit.getValue() == null)
                    {
                        return new BooleanExpression(expr, Expression.OP_LIKE,
                            ExpressionUtils.getEscapedPatternExpression(substrExpr));
                    }
                }
View Full Code Here

//                SQLExpression numExpr = (SQLExpression)args.get(1);
                // TODO Use numExpr in a SUBSTRING
                if (substrExpr.isParameter())
                {
                    // Any pattern expression cannot be a parameter here
                    SQLLiteral substrLit = (SQLLiteral)substrExpr;
                    stmt.getQueryGenerator().useParameterExpressionAsLiteral(substrLit);
                    if (substrLit.getValue() == null)
                    {
                        return new BooleanExpression(expr, Expression.OP_LIKE,
                            ExpressionUtils.getEscapedPatternExpression(substrExpr));
                    }
                }
                SQLExpression likeSubstrExpr = new StringLiteral(stmt,
                    expr.getJavaTypeMapping(), '%', null);
                return new BooleanExpression(expr, Expression.OP_LIKE,
                    ExpressionUtils.getEscapedPatternExpression(substrExpr).add(likeSubstrExpr));
            }
            else
            {
                // Create a new StringExpression and manually update its SQL
                if (substrExpr.isParameter())
                {
                    // Any pattern expression cannot be a parameter here
                    SQLLiteral substrLit = (SQLLiteral)substrExpr;
                    stmt.getQueryGenerator().useParameterExpressionAsLiteral(substrLit);
                    if (substrLit.getValue() == null)
                    {
                        return new BooleanExpression(expr, Expression.OP_LIKE,
                            ExpressionUtils.getEscapedPatternExpression(substrExpr));
                    }
                }
View Full Code Here

TOP

Related Classes of org.datanucleus.store.rdbms.sql.expression.SQLLiteral

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.