org.apache.openjpa.jdbc.kernel.exps
Class BindVariableExpression

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.exps.EmptyExpression
      extended by org.apache.openjpa.jdbc.kernel.exps.BindVariableExpression
All Implemented Interfaces:
Serializable, Exp, Expression

 class BindVariableExpression
extends EmptyExpression

Binds a variable to a value. Typically, the initialize(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.jdbc.kernel.exps.ExpContext, java.util.Map) and #getJoins methods of this expression are not called. They are only called if the variable being bound is otherwise unused in the filter, in which case we must at least make the joins to the variable because the act of binding a variable should at least guarantee that an instance represting the variable could exist (i.e. the binding collection is not empty).

Author:
Abe White

Constructor Summary
BindVariableExpression(Variable var, PCPath val, boolean key)
          Constructor.
 
Method Summary
 void acceptVisit(ExpressionVisitor visitor)
          Accept a visit from a tree visitor.
 void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf)
          Append the SQL for this expression to the given buffer.
 Variable getVariable()
           
 ExpState initialize(Select sel, ExpContext ctx, Map contains)
          Initialize the expression.
 void selectColumns(Select sel, ExpContext ctx, ExpState state, boolean pks)
          Select just the columns for this expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindVariableExpression

public BindVariableExpression(Variable var,
                              PCPath val,
                              boolean key)
Constructor. Supply values.

Method Detail

getVariable

public Variable getVariable()

initialize

public ExpState initialize(Select sel,
                           ExpContext ctx,
                           Map contains)
Description copied from interface: Exp
Initialize the expression. This method should recursively initialize any sub-expressions or values.

Specified by:
initialize in interface Exp
Overrides:
initialize in class EmptyExpression
contains - map of relation paths to the number of times the paths appear in a contains() expression; used to ensure paths used for contains() within the same AND expression used different aliases

appendTo

public void appendTo(Select sel,
                     ExpContext ctx,
                     ExpState state,
                     SQLBuffer buf)
Description copied from interface: Exp
Append the SQL for this expression to the given buffer. The SQL should optionally include any joins this expression needs.

Specified by:
appendTo in interface Exp
Overrides:
appendTo in class EmptyExpression

selectColumns

public void selectColumns(Select sel,
                          ExpContext ctx,
                          ExpState state,
                          boolean pks)
Description copied from interface: Exp
Select just the columns for this expression.

Specified by:
selectColumns in interface Exp
Overrides:
selectColumns in class EmptyExpression

acceptVisit

public void acceptVisit(ExpressionVisitor visitor)
Description copied from interface: Expression
Accept a visit from a tree visitor.

Specified by:
acceptVisit in interface Expression
Overrides:
acceptVisit in class EmptyExpression


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.