org.apache.openjpa.persistence.criteria
Class ParameterExpressionImpl<T>
java.lang.Object
org.apache.openjpa.persistence.criteria.SelectionImpl<X>
org.apache.openjpa.persistence.criteria.ExpressionImpl<T>
org.apache.openjpa.persistence.criteria.ParameterExpressionImpl<T>
- Type Parameters:
T
- the type of value held by this parameter.
- All Implemented Interfaces:
- Expression<T>, ParameterExpression<T>, Selection<T>, Parameter<T>, TupleElement<T>, CriteriaExpression
class ParameterExpressionImpl<T>
- extends ExpressionImpl<T>
- implements ParameterExpression<T>
Parameter of a criteria query.
A parameter in CriteriaQuery is always a named parameter but can be constructed with a null name.
Positional parameters are not allowed in CriteraQuery.
- Author:
- Pinaki Poddar, Fay wang
Methods inherited from class org.apache.openjpa.persistence.criteria.SelectionImpl |
acceptVisit, alias, asProjection, assertValidName, asVariable, getAlias, getCompoundSelectionItems, getJavaType, isAliased, isAutoAliased, isCompoundSelection, setAutoAlias |
ParameterExpressionImpl
public ParameterExpressionImpl(Class<T> cls,
String name)
- Construct a Parameter of given expected value type and name.
- Parameters:
cls
- expected value typename
- name of the parameter which can be null.
getName
public final String getName()
- Gets the name of this parameter.
The name can be null.
- Specified by:
getName
in interface Parameter<T>
getPosition
public final Integer getPosition()
- Raises an internal exception because parameters of CriteriaQuery
are not positional.
- Specified by:
getPosition
in interface Parameter<T>
setIndex
void setIndex(int index)
toString
public String toString()
- Overrides:
toString
in class Object
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<T>
- Parameters:
factory
- creates the kernel expressionq
- the query definition context of this expression
- Returns:
- an equivalent kernel value
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<T>
getParameterType
public Class<T> getParameterType()
- Specified by:
getParameterType
in interface Parameter<T>
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.