Package org.eclipse.persistence.internal.expressions

Examples of org.eclipse.persistence.internal.expressions.RelationExpression


        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here


        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

     @param value expression
     *  @return in predicate
     */
    public In<T> value(Expression<? extends T> value) {
        if (!(((InternalExpression) value).isLiteral() || ((InternalExpression) value).isParameter())) {
            RelationExpression baseIn = (RelationExpression) this.currentNode;
            this.currentNode = baseIn.getFirstChild().in(((SubQueryImpl) value).subQuery);
            if (this.parentNode != null) {
                if (this.parentNode.isCompoundExpression()) {
                    CompoundExpression logExp = (LogicalExpression) this.parentNode;
                    if (logExp.getFirstChild() == baseIn) {
                        logExp.create(this.currentNode, logExp.getSecondChild(), logExp.getOperator());
                    } else {
                        logExp.create(logExp.getFirstChild(), this.currentNode, logExp.getOperator());
                    }
                } else {
                    FunctionExpression funcExp = (FunctionExpression) this.parentNode;
                    funcExp.getChildren().set(funcExp.getChildren().indexOf(baseIn), this.currentNode);
                }
            }
        } else {
            if (this.currentNode.isRelationExpression()) {
                RelationExpression baseIn = (RelationExpression) this.currentNode;
                ((InternalSelection) value).getCurrentNode().setLocalBase(baseIn.getFirstChild());
                ((Collection) ((CollectionExpression) baseIn.getSecondChild()).getValue()).add(((InternalSelection) value).getCurrentNode());
            } else {
                throw new IllegalStateException(ExceptionLocalization.buildMessage("CANNOT_ADD_CONSTANTS_TO_SUBQUERY_IN"));
            }
        }

View Full Code Here

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

     @param value expression
     *  @return in predicate
     */
    public In<T> value(Expression<? extends T> value) {
        if (!(((InternalExpression) value).isLiteral() || ((InternalExpression) value).isParameter())) {
            RelationExpression baseIn = (RelationExpression) this.currentNode;
            this.currentNode = baseIn.getFirstChild().in(((SubQueryImpl) value).subQuery);
            if (this.parentNode != null) {
                if (this.parentNode.isCompoundExpression()) {
                    CompoundExpression logExp = (LogicalExpression) this.parentNode;
                    if (logExp.getFirstChild() == baseIn) {
                        logExp.create(this.currentNode, logExp.getSecondChild(), logExp.getOperator());
                    } else {
                        logExp.create(logExp.getFirstChild(), this.currentNode, logExp.getOperator());
                    }
                } else {
                    FunctionExpression funcExp = (FunctionExpression) this.parentNode;
                    funcExp.getChildren().set(funcExp.getChildren().indexOf(baseIn), this.currentNode);
                }
            }
        } else {
            if (this.currentNode.isRelationExpression()) {
                RelationExpression baseIn = (RelationExpression) this.currentNode;
                ((InternalSelection) value).getCurrentNode().setLocalBase(baseIn.getFirstChild());
                ((Collection) ((CollectionExpression) baseIn.getSecondChild()).getValue()).add(((InternalSelection) value).getCurrentNode());
            } else {
                throw new IllegalStateException(ExceptionLocalization.buildMessage("CANNOT_ADD_CONSTANTS_TO_SUBQUERY_IN"));
            }
        }

View Full Code Here

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

     @param value expression
     *  @return in predicate
     */
    public In<T> value(Expression<? extends T> value) {
        if (!(((InternalExpression) value).isLiteral() || ((InternalExpression) value).isParameter())) {
            RelationExpression baseIn = (RelationExpression) this.currentNode;
            this.currentNode = baseIn.getFirstChild().in(((SubQueryImpl) value).subQuery);
            if (this.parentNode != null) {
                if (this.parentNode.isCompoundExpression()) {
                    CompoundExpression logExp = (LogicalExpression) this.parentNode;
                    if (logExp.getFirstChild() == baseIn) {
                        logExp.create(this.currentNode, logExp.getSecondChild(), logExp.getOperator());
                    } else {
                        logExp.create(logExp.getFirstChild(), this.currentNode, logExp.getOperator());
                    }
                } else {
                    FunctionExpression funcExp = (FunctionExpression) this.parentNode;
                    funcExp.getChildren().set(funcExp.getChildren().indexOf(baseIn), this.currentNode);
                }
            }
        } else {
            if (this.currentNode.isRelationExpression()) {
                RelationExpression baseIn = (RelationExpression) this.currentNode;
                ((InternalSelection) value).getCurrentNode().setLocalBase(baseIn.getFirstChild());
                ((Collection) ((CollectionExpression) baseIn.getSecondChild()).getValue()).add(((InternalSelection) value).getCurrentNode());
            } else {
                throw new IllegalStateException(ExceptionLocalization.buildMessage("CANNOT_ADD_CONSTANTS_TO_SUBQUERY_IN"));
            }
        }
        this.expressions.add(value);
View Full Code Here

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.expressions.RelationExpression

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.