Package org.jboss.as.cmp.ejbql

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


    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 CmpMessages.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 CmpMessages.MESSAGES.limitParameterMustBeInt();
                }
                limitParam = param.number;
View Full Code Here


            } else {
                String alias = aliasManager.getAlias(path.getPath(path.size() - 2));
                SQLUtil.getIsNullClause(node.not, field, alias, sql);
            }
        } 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

        }

        sql.append(SQLUtil.EXISTS).append('(').append(SQLUtil.SELECT);

        if (member instanceof ASTParameter) {
            ASTParameter toParam = (ASTParameter) member;
            verifyParameterEntityType(toParam.number, colEntity);
            inputParameters.addAll(QueryParameter.createParameters(toParam.number - 1, colEntity));

            String parentAlias = aliasManager.getAlias(colPath.getPath(0));
            String localParentAlias = aliasManager.getAlias(colPath.getPath(0) + "_local");
View Full Code Here

        String fromAlias = aliasManager.getAlias(fromPath.getPath(fromPath.size() - 2));
        CMPFieldBridge fromCMPField = (CMPFieldBridge) 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

        addLeftJoinPath(fromPath);
        String fromAlias = aliasManager.getAlias(fromPath.getPath());
        JDBCAbstractEntityBridge fromEntity = (JDBCAbstractEntityBridge) 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

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.