Package org.datanucleus.store.query

Examples of org.datanucleus.store.query.QueryInvalidParametersException


            {
                paramType = ParameterType.NUMBERED;
            }
            else if (paramType == ParameterType.NAMED)
            {
                throw new QueryInvalidParametersException("Query is using named parameters yet also has \"" + id + "\"");
            }
            String paramName = id.substring(1);
            try
            {
                Node node = new ParameterNode(NodeType.PARAMETER, Integer.valueOf(paramName), parameterPosition);
                parameterPosition++;
                stack.push(node);
                return true;
            }
            catch (NumberFormatException nfe)
            {
                throw new NucleusUserException("Numbered parameter syntax starting ? but isnt followed by numeric!");
            }
        }
        else if (first == ':')
        {
            // Named parameter - stored as String
            if (paramType == null)
            {
                paramType = ParameterType.NAMED;
            }
            else if (paramType == ParameterType.NUMBERED)
            {
                throw new QueryInvalidParametersException("Query is using numbered parameters yet also has \"" + id + "\"");
            }
            Node node = new ParameterNode(NodeType.PARAMETER, id.substring(1), parameterPosition);
            parameterPosition++;
            stack.push(node);
            return true;
View Full Code Here


            {
                paramType = ParameterType.NUMBERED;
            }
            else if (paramType == ParameterType.NAMED)
            {
                throw new QueryInvalidParametersException("Query is using named parameters yet also has \"" + id + "\"");
            }
            String paramName = id.substring(1);
            try
            {
                Node expr = new ParameterNode(Node.PARAMETER, new Integer(paramName), parameterPosition);
                parameterPosition++;
                stack.push(expr);
                return true;
            }
            catch (NumberFormatException nfe)
            {
                throw new NucleusUserException("Numbered parameter syntax starting ? but isnt followed by numeric!");
            }
        }
        else if (first == ':')
        {
            // Named parameter - stored as String
            if (paramType == null)
            {
                paramType = ParameterType.NAMED;
            }
            else if (paramType == ParameterType.NUMBERED)
            {
                throw new QueryInvalidParametersException("Query is using numbered parameters yet also has \"" + id + "\"");
            }
            Node expr = new ParameterNode(Node.PARAMETER, id.substring(1), parameterPosition);
            parameterPosition++;
            stack.push(expr);
            return true;
View Full Code Here

    protected void assertValidTypeForParameterComparison(ScalarExpression expr, Class type)
    {
        if ((checkForTypeAssignability || expr.checkForTypeAssignability) &&
            expr.parameterName != null && !type.isAssignableFrom(expr.getClass()))
        {
            throw new QueryInvalidParametersException(LOCALISER.msg("021114",
                expr.parameterName, getClass().getName(), expr.getClass().getName()));
        }
    }
View Full Code Here

TOP

Related Classes of org.datanucleus.store.query.QueryInvalidParametersException

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.