Package org.apache.openjpa.kernel.exps

Examples of org.apache.openjpa.kernel.exps.Value


        inAssignSubselectProjection = true;
        exps.projections = new Value[1];
        exps.projectionClauses = new String[1];
        exps.projectionAliases = new String[1];

        Value val = getValue(node);
        exps.projections[0] = val;
        exps.projectionClauses[0] =
            projectionClause(node.id == JJTSCALAREXPRESSION ?
                firstChild(node) : node);
        inAssignSubselectProjection = false;
View Full Code Here


        for (int i = 0; i < count; i++) {
            JPQLNode parent = parametersNode.getChild(i);
            JPQLNode node = firstChild(parent);
            JPQLNode aliasNode = parent.children.length > 1 ? right(parent)
                : null;
            Value proj = getValue(node);
            String alias = aliasNode != null ? aliasNode.text :
                projectionClause(node.id == JJTSCALAREXPRESSION ?
                        firstChild(node) : node);
            if (aliasNode != null)
                proj.setAlias(alias);
            projections.add(proj);
            projectionClauses.add(alias);
            projectionAliases.add(alias);
        }
        return exp;
View Full Code Here

                projectionClauses.addAll(clauses);

            } else {
                JPQLNode aliasNode = parent.children.length > 1 ? right(parent)
                        : null;
                Value proj = getValue(node);
                String alias = aliasNode != null ? aliasNode.text :
                    projectionClause(node.id == JJTSCALAREXPRESSION ?
                            firstChild(node) : node);
                if (aliasNode != null)
                    proj.setAlias(alias);
                projections.add(proj);
                projectionClauses.add(alias);
                projectionAliases.add(alias);
                Class<?> type = proj.getType();
                ResultShape<?> projShape = new ResultShape(type, new FillStrategy.Assign(), type.isPrimitive());

                if (count == 1)
                    resultShape = projShape;
                else
View Full Code Here

        inAssignSubselectProjection = true;
        exps.projections = new Value[1];
        exps.projectionClauses = new String[1];
        exps.projectionAliases = new String[1];

        Value val = getValue(node);
        exps.projections[0] = val;
        exps.projectionClauses[0] =
            projectionClause(node.id == JJTSCALAREXPRESSION ?
                firstChild(node) : node);
        inAssignSubselectProjection = false;
View Full Code Here

        for (int i = 0; i < count; i++) {
            JPQLNode parent = parametersNode.getChild(i);
            JPQLNode node = firstChild(parent);
            JPQLNode aliasNode = parent.children.length > 1 ? right(parent)
                : null;
            Value proj = getValue(node);
            String alias = aliasNode != null ? aliasNode.text :
                projectionClause(node.id == JJTSCALAREXPRESSION ?
                        firstChild(node) : node);
            if (aliasNode != null)
                proj.setAlias(alias);
            projections.add(proj);
            projectionClauses.add(alias);
            projectionAliases.add(alias);
        }
        return exp;
View Full Code Here

                projectionClauses.addAll(clauses);

            } else {
                JPQLNode aliasNode = parent.children.length > 1 ? right(parent)
                        : null;
                Value proj = getValue(node);
                String alias = aliasNode != null ? aliasNode.text :
                    projectionClause(node.id == JJTSCALAREXPRESSION ?
                            firstChild(node) : node);
                if (aliasNode != null)
                    proj.setAlias(alias);
                projections.add(proj);
                projectionClauses.add(alias);
                projectionAliases.add(alias);
                Class<?> type = proj.getType();
                ResultShape<?> projShape = new ResultShape(type, new FillStrategy.Assign(), type.isPrimitive());

                if (count == 1)
                    resultShape = projShape;
                else
View Full Code Here

        exps.grouping = new Value[groupByCount];

        for (int i = 0; i < groupByCount; i++) {
            JPQLNode node = groupByNode.getChild(i);
            Value val = getValue(node);
            if (val instanceof Path) {
                FieldMetaData fmd = ((Path) val).last();
                if (fmd != null && fmd.getValue().getTypeMetaData() != null && fmd.getValue().isEmbedded())
                    throw parseException(EX_USER, "cant-groupby-embeddable",
                        new Object[]{ node.getChildCount() > 1 ? assemble(node) : node.text }, null);
View Full Code Here

            if (path.last().getValue().getEmbeddedMetaData() != null)
                throw parseException(EX_USER, "cant-bulk-update-embeddable",
                        new Object[]{assemble(firstChild(nodes[i]))}, null);

            JPQLNode lastChild = lastChild(nodes[i]);
            Value val = (lastChild.children == null)
                      ? null : getValue(onlyChild(lastChild));
            exps.putUpdate(path, val);
        }
    }
View Full Code Here

        return exp;
    }

    private Expression getSubquery(String alias, Path path, Expression exp) {
        Value var = getVariable(alias, true);
        // this bind is for validateMapPath to resolve alias
        Expression bindVar = factory.bindVariable(var, path);
        FieldMetaData fmd = path.last();
        ClassMetaData candidate = getFieldType(fmd);
        if (candidate == null && fmd.isElementCollection())
View Full Code Here

            throw parseException(EX_USER, "path-no-meta",
                new Object[]{ path, null }, null);

        String alias = aliasNode != null ? aliasNode.text : nextAlias();

        Value var = getVariable(alias, true);
        var.setMetaData(getFieldType(fmd));

        Expression join = null;

        // if the variable is already bound, get the var's value and
        // do a regular contains with that
View Full Code Here

TOP

Related Classes of org.apache.openjpa.kernel.exps.Value

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.