FileDocCategorySizeDatePackage
LogicalExpression.javaAPI DocGlassfish v2 API5163Tue May 22 16:54:32 BST 2007oracle.toplink.essentials.internal.expressions

LogicalExpression

public class LogicalExpression extends CompoundExpression
Used for logical AND and OR. This is not used by NOT.

Fields Summary
Constructors Summary
public LogicalExpression()
LogicalExpression constructor comment.

        super();
    
Methods Summary
public java.lang.StringdescriptionOfNodeType()
INTERNAL: Used for debug printing.

        return "Logical";
    
public booleandoesConform(java.lang.Object object, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.queryframework.InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean objectIsUnregistered)
INTERNAL: Check if the object conforms to the expression in memory. This is used for in-memory querying. If the expression in not able to determine if the object conform throw a not supported exception.

        // This should always be and or or.
        if (getOperator().getSelector() == ExpressionOperator.And) {
            return getFirstChild().doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered) && getSecondChild().doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered);
        } else if (getOperator().getSelector() == ExpressionOperator.Or) {
            return getFirstChild().doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered) || getSecondChild().doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered);
        }

        throw QueryException.cannotConformExpression();

    
public booleanextractPrimaryKeyValues(boolean requireExactMatch, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor, oracle.toplink.essentials.internal.sessions.AbstractRecord primaryKeyRow, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow)
INTERNAL: Extract the primary key from the expression into the row. Ensure that the query is quering the exact primary key. Return false if not on the primary key.

        // If this is a primary key expression then it can only have and/or relationships.
        if (getOperator().getSelector() != ExpressionOperator.And) {
            // If this is an exact primary key expression it can not have ors.
            // After fixing bug 2782991 this must now work correctly.
            if (requireExactMatch || (getOperator().getSelector() != ExpressionOperator.Or)) {
                return false;
            }
        }
        boolean validExpression = getFirstChild().extractPrimaryKeyValues(requireExactMatch, descriptor, primaryKeyRow, translationRow);
        if (requireExactMatch && (!validExpression)) {
            return false;
        }
        return getSecondChild().extractPrimaryKeyValues(requireExactMatch, descriptor, primaryKeyRow, translationRow);
    
public booleanisLogicalExpression()
INTERNAL:

        return true;