org.apache.openjpa.persistence
Class ParameterImpl<T>

java.lang.Object
  extended by org.apache.openjpa.persistence.ParameterImpl<T>
Type Parameters:
T - type of value carried by this parameter.
All Implemented Interfaces:
Parameter<T>

public class ParameterImpl<T>
extends Object
implements Parameter<T>

A user-defined parameter of a query. A parameter is uniquely identified within the scope of a query by either its name or integral position. The integral position refers to the integer key as specified by the user. The index of this parameter during execution in a datastore query may be different.
A value can be bound to this parameter. This behavior of a parameter carrying its own value is a change from earlier versions (where no explicit abstraction existed for a query parameter).

Since:
2.0.0
Author:
Pinaki Poddar

Constructor Summary
ParameterImpl(int position, Class<T> expectedValueType)
          Construct a positional parameter with the given position as key and given expected value type.
ParameterImpl(String name, Class<T> expectedValueType)
          Construct a named parameter with the given name as key and given expected value type.
 
Method Summary
 boolean equals(Object other)
          Equals if the other parameter has the same name or position.
 String getName()
           
 Class<T> getParameterType()
           
 Integer getPosition()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterImpl

public ParameterImpl(int position,
                     Class<T> expectedValueType)
Construct a positional parameter with the given position as key and given expected value type.


ParameterImpl

public ParameterImpl(String name,
                     Class<T> expectedValueType)
Construct a named parameter with the given name as key and given expected value type.

Method Detail

getName

public final String getName()
Specified by:
getName in interface Parameter<T>

getPosition

public final Integer getPosition()
Specified by:
getPosition in interface Parameter<T>

getParameterType

public Class<T> getParameterType()
Specified by:
getParameterType in interface Parameter<T>

equals

public boolean equals(Object other)
Equals if the other parameter has the same name or position.

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


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