Package org.apache.cayenne.ejbql

Examples of org.apache.cayenne.ejbql.EJBQLException


    protected void processIntermediatePathComponent() {
        ObjRelationship relationship = (ObjRelationship) currentEntity
                .getRelationship(lastPathComponent);
        if (relationship == null) {
            throw new EJBQLException("Unknown relationship '"
                    + lastPathComponent
                    + "' for entity '"
                    + currentEntity.getName()
                    + "'");
        }
View Full Code Here


                    context.append(alias).append('.');
                }
                context.append(pk.getName());
            }
            else {
                throw new EJBQLException(
                        "Multi-column PK to-many matches are not yet supported.");
            }
           
        }
        else {
View Full Code Here

    public boolean visitIdentifier(EJBQLExpression expression) {

        // expression id is always rooted in an ObjEntity, even for DbPath...
        ClassDescriptor descriptor = context.getEntityDescriptor(expression.getText());
        if (descriptor == null) {
            throw new EJBQLException("Invalid identification variable: "
                    + expression.getText());
        }

        this.currentEntity = descriptor.getEntity().getDbEntity();
        this.idPath = expression.getText();
View Full Code Here

    private void processIntermediatePathComponent() {
        DbRelationship relationship = (DbRelationship) currentEntity
                .getRelationship(lastPathComponent);
        if (relationship == null) {
            throw new EJBQLException("Unknown relationship '"
                    + lastPathComponent
                    + "' for entity '"
                    + currentEntity.getName()
                    + "'");
        }
View Full Code Here

                    context.append(alias).append('.');
                }
                context.append(pk.getName());
            }
            else {
                throw new EJBQLException(
                        "Multi-column PK to-many matches are not yet supported.");
            }
        }
        else {
            // match FK against the target object
View Full Code Here

            idAliases.put(alias, id);
            return alias;
        }

        throw new EJBQLException("Failed to create id alias");
    }
View Full Code Here

     * Returns a positional EntityResult, incrementing position index on each call.
     */
    EntityResultSegment nextEntityResult() {

        if (resultSetMetadata == null) {
            throw new EJBQLException(
                    "No result set mapping exists for expression, can't map EntityResult");
        }

        return (EntityResultSegment) resultSetMetadata.get(resultDescriptorPosition++);
    }
View Full Code Here

     * Returns a positional column alias, incrementing position index on each call.
     */
    String nextColumnAlias() {

        if (resultSetMetadata == null) {
            throw new EJBQLException(
                    "No result set mapping exists for expression, can't map column aliases");
        }

        return ((ScalarResultSegment) resultSetMetadata.get(resultDescriptorPosition++))
                .getColumn();
View Full Code Here

            // check multicolumn match condition and undo op insertion and append it
            // from scratch if needed
            if (multiColumnOperands != null) {

                if (multiColumnOperands.size() != 2) {
                    throw new EJBQLException(
                            "Invalid multi-column equals expression. Expected 2 multi-column operands, got "
                                    + multiColumnOperands.size());
                }

                context.trim(2);
View Full Code Here

            return true;
        }

        @Override
        protected void appendMultiColumnPath(EJBQLMultiColumnOperand operand) {
            throw new EJBQLException("Can't use multi-column paths in column clause");
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.ejbql.EJBQLException

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.