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

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.exps.WhenCondition

public class WhenCondition
extends Object

Value produced by a when_clause of a case expression.

Author:
Catalina Wei
See Also:
Serialized Form

Constructor Summary
WhenCondition(org.apache.openjpa.jdbc.kernel.exps.Exp exp, Val val)
          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.
 org.apache.openjpa.jdbc.kernel.exps.Exp getExp()
           
 int getId()
           
 Class getType()
           
 Val getVal()
           
 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

WhenCondition

public WhenCondition(org.apache.openjpa.jdbc.kernel.exps.Exp exp,
                     Val val)
Constructor.

Method Detail

getExp

public org.apache.openjpa.jdbc.kernel.exps.Exp getExp()

getVal

public Val getVal()

getType

public Class getType()

initialize

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

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)
Append the SQL for this expression to the given buffer. The SQL should optionally include any joins this expression needs.


selectColumns

public void selectColumns(Select sel,
                          ExpContext ctx,
                          ExpState state,
                          boolean pks)
Select just the columns for this expression.


acceptVisit

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


getId

public int getId()


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