Package org.jpox.store.mapped.expression

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


                    paramExpr.checkForTypeAssignability();
                    return paramExpr;
                }
                else
                {
                    return new NullLiteral(qs);
                }
            }

            if (!executionCompile)
            {
View Full Code Here


            else
            {
                Object parameterValue = parameters.get(id);
                if (parameterValue == null)
                {
                    expr = new NullLiteral(qs);
                }
                else
                {
                    expr = m.newLiteral(qs, parameterValue);
                    expr.setParameterName(id);
View Full Code Here

                        return paramExpr;
                    }
                }
                else
                {
                    return new NullLiteral(qs);
                }
            }

            if (parameters.size() < implicitParamNo+1)
            {
                // Already used up all parameters available
                throw new JPOXUserException(LOCALISER.msg("021056", "" + id, "" + implicitParamNo));
            }

            // Find the next implicit parameter available and assign to this implicit parameter
            if (!parameters.containsKey("JPOX_" + implicitParamNo))
            {
                throw new JPOXUserException(LOCALISER.msg("021056", "" + id, "" + implicitParamNo));
            }
            Object paramValue = parameters.get("JPOX_" + implicitParamNo);

            // Replace the value key with the true name in case its used again
            parameters.put(id, paramValue);
            parameters.remove("JPOX_" + implicitParamNo);
            implicitParamNo++;
            if (paramValue != null)
            {
                if (parentExpr != null && paramValue instanceof String && ((String)paramValue).startsWith("this"))
                {
                    // Subquery with parameter pointing back to a field of the parent query
                    return getExpressionForSubqueryParentParameter((String)paramValue);
                }
                else
                {
                    JavaTypeMapping m = srm.getDatastoreAdapter().getMapping(paramValue.getClass(), srm, clr);
                    ScalarExpression paramExpr = m.newLiteral(qs, paramValue);
                    paramExpr.setParameterName(id);
                    return paramExpr;
                }
            }
            else
            {
                return new NullLiteral(qs);
            }
        }
        else
        {
            if (executionCompile)
            {
                throw new JPOXUserException(LOCALISER.msg("021056", "" + id, "" + implicitParamNo));
            }
            else
            {
                // We have no value available at precompile so just give it a null for now
                return new NullLiteral(qs);
            }
        }
    }
View Full Code Here

TOP

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

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.