
org.eclipse.persistence.jpa.jpql.parser.OrExpression Maven / Gradle / Ivy
Show all versions of eclipselink Show documentation
/*******************************************************************************
* Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation
*
******************************************************************************/
package org.eclipse.persistence.jpa.jpql.parser;
/**
* The OR logical operator chains multiple criteria together. A valid operand of an OR
* operator must be one of: TRUE, FALSE, and NULL. The OR operator has
* a lower precedence than the AND operator.
*
* NULL represents unknown. Therefore, if one operand is NULL and the other operand is
* TRUE the result is TRUE, because one TRUE operand is sufficient for a
* TRUE result. If one operand is NULL and the other operand is either FALSE or
* NULL, the result is NULL (unknown).
*
* The following table shows how the OR operator is evaluated based on its two operands:
*
*
*
*
* TRUE FALSE NULL
* TRUE TRUE TRUE TRUE
* FALSE TRUE FALSE NULL
* NULL TRUE NULL NULL
*
*
*
*
BNF: conditional_expression ::= conditional_expression OR conditional_term
*
* @version 2.4.2
* @since 2.3
* @author Pascal Filion
*/
public final class OrExpression extends LogicalExpression {
/**
* Creates a new OrExpression
.
*
* @param parent The parent of this expression
*/
public OrExpression(AbstractExpression parent) {
super(parent, OR);
}
/**
* {@inheritDoc}
*/
public void accept(ExpressionVisitor visitor) {
visitor.visit(this);
}
/**
* {@inheritDoc}
*/
@Override
public String leftExpressionBNF() {
return ConditionalExpressionBNF.ID;
}
/**
* {@inheritDoc}
*/
@Override
public String rightExpressionBNF() {
return ConditionalTermBNF.ID;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy