Examples of ExpressionException


Examples of org.apache.cayenne.exp.ExpressionException

    @Override
    public Iterator<CayenneMapEntry> resolvePathComponents(Expression pathExp)
            throws ExpressionException {
        if (pathExp.getType() != Expression.DB_PATH) {
            throw new ExpressionException("Invalid expression type: '"
                    + pathExp.expName()
                    + "',  DB_PATH is expected.");
        }

        return new PathIterator((String) pathExp.getOperand(0));
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

                    newChildren[j++] = c;
                }
            }

            if (j != newSize) {
                throw new ExpressionException("Assertion error: " + j + " != " + newSize);
            }

            this.children = newChildren;
        }
    }
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

        try {
            return evaluateNode(o);
        }
        catch (Throwable th) {
            String string = this.toString();
            throw new ExpressionException(
                    "Error evaluating expression '" + string + "'",
                    string,
                    Util.unwindException(th));
        }
    }
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

        // see if this is an attribute
        Attribute attr = currentEntity.getAttribute(pathComp);
        if (attr != null) {
            // do a sanity check...
            if (toks.hasMoreTokens())
                throw new ExpressionException(
                        "Attribute must be the last component of the path: '"
                                + pathComp
                                + "'.",
                        path,
                        null);
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

                .append(": [")
                .append(currentEntity.getName())
                .append('.')
                .append(pathComponent)
                .append("].");
        return new ExpressionException(buffer.toString(), path, null);
    }
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

                            .getOperand(0), aliasMap);
                }
            };
        }

        throw new ExpressionException("Invalid expression type: '"
                + pathExp.expName()
                + "',  OBJ_PATH is expected.");
    }
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

            throws ExpressionException {

        // resolve DB_PATH if we can
        if (pathExp.getType() == Expression.DB_PATH) {
            if (getDbEntity() == null) {
                throw new ExpressionException("Can't resolve DB_PATH '"
                        + pathExp
                        + "', DbEntity is not set.");
            }

            return getDbEntity().resolvePathComponents(pathExp);
        }

        if (pathExp.getType() == Expression.OBJ_PATH) {
            return new PathIterator((String) pathExp.getOperand(0));
        }

        throw new ExpressionException("Invalid expression type: '"
                + pathExp.expName()
                + "',  OBJ_PATH is expected.");
    }
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

                            .getOperand(0), aliasMap);
                }
            };
        }

        throw new ExpressionException("Invalid expression type: '"
                + pathExp.expName()
                + "',  DB_PATH is expected.");
    }
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

    @Override
    public Iterator<CayenneMapEntry> resolvePathComponents(Expression pathExp)
            throws ExpressionException {
        if (pathExp.getType() != Expression.DB_PATH) {
            throw new ExpressionException("Invalid expression type: '"
                    + pathExp.expName()
                    + "',  DB_PATH is expected.");
        }

        return new PathIterator((String) pathExp.getOperand(0));
View Full Code Here

Examples of org.apache.cayenne.exp.ExpressionException

            // see if this is an attribute
            Attribute attr = currentEnt.getAttribute(pathComp);
            if (attr != null) {
                // do a sanity check...
                if (toks.hasMoreTokens())
                    throw new ExpressionException(
                            "Attribute must be the last component of the path: '"
                                    + pathComp
                                    + "'.",
                            path,
                            null);

                return attr;
            }

            Relationship rel = currentEnt.getRelationship(pathComp);
            if (rel != null) {
                currentEnt = rel.getTargetEntity();
                return rel;
            }

            // build error message
            StringBuilder buf = new StringBuilder();
            buf
                    .append("Can't resolve path component: [")
                    .append(currentEnt.getName())
                    .append('.')
                    .append(pathComp)
                    .append("].");
            throw new ExpressionException(buf.toString(), path, null);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.