org.apache.openjpa.persistence.criteria
Class ExpressionImpl<X>

java.lang.Object
  extended by org.apache.openjpa.persistence.criteria.SelectionImpl<X>
      extended by org.apache.openjpa.persistence.criteria.ExpressionImpl<X>
Type Parameters:
X - the type of the value this expression represents.
All Implemented Interfaces:
Expression<X>, Selection<X>, TupleElement<X>, CriteriaExpression
Direct Known Subclasses:
Expressions.BinarayFunctionalExpression, Expressions.Case, Expressions.CastAs, Expressions.Coalesce, Expressions.Constant, Expressions.CurrentDate, Expressions.CurrentTime, Expressions.CurrentTimestamp, Expressions.FunctionalExpression, Expressions.ListArgument, Expressions.Locate, Expressions.Nullif, Expressions.SimpleCase, Expressions.SubqueryExpression, Expressions.UnaryFunctionalExpression, Joins.MapEntry, ParameterExpressionImpl, PathImpl, PredicateImpl, SubqueryImpl

abstract class ExpressionImpl<X>
extends SelectionImpl<X>
implements Expression<X>

Expression node for Criteria query. Acts a bridge pattern to equivalent kernel representation.

Since:
2.0.0
Author:
Pinaki Poddar

Constructor Summary
ExpressionImpl(Class<X> cls)
           
 
Method Summary
<Y> Expression<Y>
as(Class<Y> type)
          Creates a new expression of the given type.
 Predicate in(Collection<?> values)
          Create a predicate to test whether this expression is a member of the given collection element values.
 Predicate in(Expression<?>... values)
          Create a predicate to test whether this expression is a member of the given argument expressions.
 Predicate in(Expression<Collection<?>> values)
          Create a predicate to test whether this expression is a member of the given expression representing a collection.
 Predicate in(Object... values)
          Create a predicate to test whether this expression is a member of the given argument values.
 Predicate isNotNull()
          Create a predicate to test whether this expression is not null.
 Predicate isNull()
          Create a predicate to test whether this expression is null.
(package private)  Expression toKernelExpression(ExpressionFactory factory, CriteriaQueryImpl<?> q)
          Bridge contract to convert this facade expression to a kernel expression.
(package private) abstract  Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q)
          Bridge contract to convert this facade expression to a kernel value.
 
Methods inherited from class org.apache.openjpa.persistence.criteria.SelectionImpl
acceptVisit, alias, asProjection, assertValidName, asValue, 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.Selection
alias, getCompoundSelectionItems, isCompoundSelection
 
Methods inherited from interface javax.persistence.TupleElement
getAlias, getJavaType
 

Constructor Detail

ExpressionImpl

public ExpressionImpl(Class<X> cls)
Parameters:
cls - the type of the evaluated result of the expression
Method Detail

as

public <Y> Expression<Y> as(Class<Y> type)
Creates a new expression of the given type. If the given type is same as this expression's type then returns the same instance. May cause runtime cast failure if this expression's immutable type is not convertible to the given type.

Specified by:
as in interface Expression<X>

in

public Predicate in(Object... values)
Create a predicate to test whether this expression is a member of the given argument values.

Specified by:
in in interface Expression<X>

in

public Predicate in(Expression<?>... values)
Create a predicate to test whether this expression is a member of the given argument expressions.

Specified by:
in in interface Expression<X>

in

public Predicate in(Collection<?> values)
Create a predicate to test whether this expression is a member of the given collection element values.

Specified by:
in in interface Expression<X>

in

public Predicate in(Expression<Collection<?>> values)
Create a predicate to test whether this expression is a member of the given expression representing a collection.

Specified by:
in in interface Expression<X>

isNotNull

public Predicate isNotNull()
Create a predicate to test whether this expression is not null.

Specified by:
isNotNull in interface Expression<X>

isNull

public Predicate isNull()
Create a predicate to test whether this expression is null.

Specified by:
isNull in interface Expression<X>

toValue

abstract Value toValue(ExpressionFactory factory,
                       CriteriaQueryImpl<?> q)
Bridge contract to convert this facade expression to a kernel value.

Parameters:
factory - creates the kernel expression
q - the query definition context of this expression
Returns:
an equivalent kernel value

toKernelExpression

Expression toKernelExpression(ExpressionFactory factory,
                              CriteriaQueryImpl<?> q)
Bridge contract to convert this facade expression to a kernel expression.

Parameters:
factory - creates the kernel expression
q - the query definition context of this expression
Returns:
an equivalent kernel expression


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