Package org.apache.cayenne.exp

Examples of org.apache.cayenne.exp.ExpressionException


        // in the grammar... do it here...

        // disallow non-aggregated condition parents...
        if (!(n instanceof AggregateConditionNode)) {
            String label = (n instanceof SimpleNode) ? ((SimpleNode)n).expName() : String.valueOf(n);
            throw new ExpressionException(expName() + ": invalid parent - " + label);
        }

        super.jjtSetParent(n);
    }
View Full Code Here


                    newChildren[j++] = c;
                }
            }

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

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

        // wrap in try/catch to provide unified exception processing
        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

        out.append(getEJBQLExpressionOperator(0));
        out.append(" ");

        Object literal = ((ASTScalar) children[1]).getValue();
        if (!(literal instanceof String)) {
            throw new ExpressionException("Literal value should be a string");
        }
        SimpleNode.appendScalarAsString(out, ((String) literal).toUpperCase(), '\'');
    }
View Full Code Here

        setValue(value);
    }

    @Override
    protected Object evaluateNode(Object o) throws Exception {
        throw new ExpressionException("Uninitialized parameter: " + value + ", call 'expWithParameters' first.");
    }
View Full Code Here

    }

    @Override
    public void setValue(Object value) {
        if (value == null) {
            throw new ExpressionException("Null Parameter value");
        }

        String name = value.toString().trim();
        if (name.length() == 0) {
            throw new ExpressionException("Empty Parameter value");
        }

        super.setValue(new ExpressionParameter(name));
    }
View Full Code Here

                    return new PathComponentIterator(DbEntity.this, (String) pathExp.getOperand(0), aliasMap);
                }
            };
        }

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

    }

    @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

            if (constValue != null) {
                return constValue;
            }
        }
        catch (IllegalAccessException e) {
            throw new ExpressionException("Can't access const field", e);
        }
        return (o instanceof DataObject)
                ? ((DataObject) o).readNestedProperty(path)
                : (o instanceof Entity) ? evaluateEntityNode((Entity) o) : PropertyUtils
                        .getProperty(o, path);
View Full Code Here

                    newChildren[j++] = c;
                }
            }

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

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

TOP

Related Classes of org.apache.cayenne.exp.ExpressionException

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.