Package org.jboss.as.cmp.ejbql

Examples of org.jboss.as.cmp.ejbql.ASTParameter


        addJoinPath(fromPath);
        fromAlias = aliasManager.getAlias(fromPath.getPath());
        fromEntity = (JDBCEntityBridge) fromPath.getEntity();

        if (toNode instanceof ASTParameter) {
            ASTParameter toParam = (ASTParameter) toNode;

            // can only compare like kind entities
            verifyParameterEntityType(toParam.number, fromEntity);

            inputParameters.addAll(QueryParameter.createParameters(toParam.number - 1, fromEntity));
View Full Code Here


                }
            }

            buf = SQLUtil.getIsNullClause(node.not, field, alias, buf);
        } else if (child0 instanceof ASTParameter) {
            ASTParameter param = (ASTParameter) child0;
            Class type = getParameterType(param.number);

            QueryParameter queryParam = new QueryParameter(param.number - 1, typeFactory.getJDBCType(type));
            inputParameters.add(queryParam);
View Full Code Here

        // setup from variables
        String fromAlias = null;
        int fromParamNumber = -1;
        if (node.jjtGetChild(0) instanceof ASTParameter) {
            ASTParameter fromParam = (ASTParameter) node.jjtGetChild(0);

            // can only compare like kind entities
            verifyParameterEntityType(fromParam.number, toChildEntity);

            fromParamNumber = fromParam.number;
View Full Code Here

        String fromAlias = aliasManager.getAlias(fromPath.getPath(fromPath.size() - 2));
        JDBCCMPFieldBridge fromCMPField = (JDBCCMPFieldBridge) fromPath.getCMPField();

        Node toNode = node.jjtGetChild(1);
        if (toNode instanceof ASTParameter) {
            ASTParameter toParam = (ASTParameter) toNode;

            // can only compare like kind entities
            Class parameterType = getParameterType(toParam.number);
            if (!(fromCMPField.getFieldType().equals(parameterType))) {
                throw new IllegalStateException("Only like types can be " +
View Full Code Here

    public Object visit(ASTLimitOffset node, Object data) {
        int child = 0;
        if (node.hasOffset) {
            Node offsetNode = node.jjtGetChild(child++);
            if (offsetNode instanceof ASTParameter) {
                ASTParameter param = (ASTParameter) offsetNode;
                Class parameterType = getParameterType(param.number);
                if (int.class != parameterType && Integer.class != parameterType) {
                    throw new UnsupportedOperationException("OFFSET parameter must be an int");
                }
                offsetParam = param.number;
            } else {
                ASTExactNumericLiteral param = (ASTExactNumericLiteral) offsetNode;
                offsetValue = (int) param.value;
            }
        }
        if (node.hasLimit) {
            Node limitNode = node.jjtGetChild(child);
            if (limitNode instanceof ASTParameter) {
                ASTParameter param = (ASTParameter) limitNode;
                Class parameterType = getParameterType(param.number);
                if (int.class != parameterType && Integer.class != parameterType) {
                    throw new UnsupportedOperationException("LIMIT parameter must be an int");
                }
                limitParam = param.number;
View Full Code Here

        addJoinPath(fromPath);
        fromAlias = aliasManager.getAlias(fromPath.getPath());
        fromEntity = (JDBCEntityBridge) fromPath.getEntity();

        if (toNode instanceof ASTParameter) {
            ASTParameter toParam = (ASTParameter) toNode;

            // can only compare like kind entities
            verifyParameterEntityType(toParam.number, fromEntity);

            inputParameters.addAll(QueryParameter.createParameters(toParam.number - 1, fromEntity));
View Full Code Here

                }
            }

            buf = SQLUtil.getIsNullClause(node.not, field, alias, buf);
        } else if (child0 instanceof ASTParameter) {
            ASTParameter param = (ASTParameter) child0;
            Class type = getParameterType(param.number);

            QueryParameter queryParam = new QueryParameter(param.number - 1, typeFactory.getJDBCType(type));
            inputParameters.add(queryParam);
View Full Code Here

        // setup from variables
        String fromAlias = null;
        int fromParamNumber = -1;
        if (node.jjtGetChild(0) instanceof ASTParameter) {
            ASTParameter fromParam = (ASTParameter) node.jjtGetChild(0);

            // can only compare like kind entities
            verifyParameterEntityType(fromParam.number, toChildEntity);

            fromParamNumber = fromParam.number;
View Full Code Here

        String fromAlias = aliasManager.getAlias(fromPath.getPath(fromPath.size() - 2));
        JDBCCMPFieldBridge fromCMPField = (JDBCCMPFieldBridge) fromPath.getCMPField();

        Node toNode = node.jjtGetChild(1);
        if (toNode instanceof ASTParameter) {
            ASTParameter toParam = (ASTParameter) toNode;

            // can only compare like kind entities
            Class parameterType = getParameterType(toParam.number);
            if (!(fromCMPField.getFieldType().equals(parameterType))) {
                throw CmpMessages.MESSAGES.onlyLikeTypesCanBeCompared(fromCMPField.getFieldType().getName(), parameterType.getName());
View Full Code Here

    public Object visit(ASTLimitOffset node, Object data) {
        int child = 0;
        if (node.hasOffset) {
            Node offsetNode = node.jjtGetChild(child++);
            if (offsetNode instanceof ASTParameter) {
                ASTParameter param = (ASTParameter) offsetNode;
                Class parameterType = getParameterType(param.number);
                if (int.class != parameterType && Integer.class != parameterType) {
                    throw MESSAGES.offsetParameterMustBeInt();
                }
                offsetParam = param.number;
            } else {
                ASTExactNumericLiteral param = (ASTExactNumericLiteral) offsetNode;
                offsetValue = (int) param.value;
            }
        }
        if (node.hasLimit) {
            Node limitNode = node.jjtGetChild(child);
            if (limitNode instanceof ASTParameter) {
                ASTParameter param = (ASTParameter) limitNode;
                Class parameterType = getParameterType(param.number);
                if (int.class != parameterType && Integer.class != parameterType) {
                    throw MESSAGES.limitParameterMustBeInt();
                }
                limitParam = param.number;
View Full Code Here

TOP

Related Classes of org.jboss.as.cmp.ejbql.ASTParameter

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.