org.apache.openjpa.persistence.criteria
Class Expressions.SimpleCase<C,R>

java.lang.Object
  extended by org.apache.openjpa.persistence.criteria.SelectionImpl<X>
      extended by org.apache.openjpa.persistence.criteria.ExpressionImpl<R>
          extended by org.apache.openjpa.persistence.criteria.Expressions.SimpleCase<C,R>
All Implemented Interfaces:
CriteriaBuilder.SimpleCase<C,R>, Expression<R>, Selection<R>, TupleElement<R>, CriteriaExpression
Enclosing class:
Expressions

public static class Expressions.SimpleCase<C,R>
extends ExpressionImpl<R>
implements CriteriaBuilder.SimpleCase<C,R>


Constructor Summary
Expressions.SimpleCase(Class<R> cls)
           
Expressions.SimpleCase(Expression<C> expr)
           
 
Method Summary
 void acceptVisit(CriteriaExpressionVisitor visitor)
          Accept visit from the given visitor.
 StringBuilder asValue(AliasContext q)
          Get a string representation of this node as a value in the context of the given query.
 Expression<C> getExpression()
           
 Expressions.SimpleCase<C,R> otherwise(Expression<? extends R> otherwise)
           
 Expressions.SimpleCase<C,R> otherwise(R otherwise)
           
 Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q)
          Bridge contract to convert this facade expression to a kernel value.
 Expressions.SimpleCase<C,R> when(C when, Expression<? extends R> then)
           
 Expressions.SimpleCase<C,R> when(C when, R then)
           
 Expressions.SimpleCase<C,R> when(Expression<C> when, Expression<? extends R> then)
           
 
Methods inherited from class org.apache.openjpa.persistence.criteria.ExpressionImpl
as, in, in, in, in, isNotNull, isNull, toKernelExpression
 
Methods inherited from class org.apache.openjpa.persistence.criteria.SelectionImpl
alias, asProjection, assertValidName, asVariable, getAlias, getCompoundSelectionItems, getJavaType, isAliased, isAutoAliased, isCompoundSelection, setAutoAlias
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.persistence.criteria.Expression
as, in, in, in, in, isNotNull, isNull
 
Methods inherited from interface javax.persistence.criteria.Selection
alias, getCompoundSelectionItems, isCompoundSelection
 
Methods inherited from interface javax.persistence.TupleElement
getAlias, getJavaType
 

Constructor Detail

Expressions.SimpleCase

public Expressions.SimpleCase(Class<R> cls)

Expressions.SimpleCase

public Expressions.SimpleCase(Expression<C> expr)
Method Detail

getExpression

public Expression<C> getExpression()
Specified by:
getExpression in interface CriteriaBuilder.SimpleCase<C,R>

when

public Expressions.SimpleCase<C,R> when(Expression<C> when,
                                        Expression<? extends R> then)

when

public Expressions.SimpleCase<C,R> when(C when,
                                        Expression<? extends R> then)
Specified by:
when in interface CriteriaBuilder.SimpleCase<C,R>

when

public Expressions.SimpleCase<C,R> when(C when,
                                        R then)
Specified by:
when in interface CriteriaBuilder.SimpleCase<C,R>

otherwise

public Expressions.SimpleCase<C,R> otherwise(Expression<? extends R> otherwise)
Specified by:
otherwise in interface CriteriaBuilder.SimpleCase<C,R>

otherwise

public Expressions.SimpleCase<C,R> otherwise(R otherwise)
Specified by:
otherwise in interface CriteriaBuilder.SimpleCase<C,R>

toValue

public Value toValue(ExpressionFactory factory,
                     CriteriaQueryImpl<?> q)
Description copied from class: ExpressionImpl
Bridge contract to convert this facade expression to a kernel value.

Specified by:
toValue in class ExpressionImpl<R>
Parameters:
factory - creates the kernel expression
q - the query definition context of this expression
Returns:
an equivalent kernel value

acceptVisit

public void acceptVisit(CriteriaExpressionVisitor visitor)
Description copied from interface: CriteriaExpression
Accept visit from the given visitor. The receiver is responsible to propagate the visitor to the constituent sub-nodes if any.

Specified by:
acceptVisit in interface CriteriaExpression
Overrides:
acceptVisit in class SelectionImpl<R>
Parameters:
visitor - a processor to walk the nodes of a tree.

asValue

public StringBuilder asValue(AliasContext q)
Description copied from interface: CriteriaExpression
Get a string representation of this node as a value in the context of the given query.

Specified by:
asValue in interface CriteriaExpression
Overrides:
asValue in class SelectionImpl<R>


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