Package org.apache.openjpa.persistence
Class ParameterImpl<T>
- java.lang.Object
-
- org.apache.openjpa.persistence.ParameterImpl<T>
-
- Type Parameters:
T
- type of value carried by this parameter.
- All Implemented Interfaces:
jakarta.persistence.Parameter<T>
public class ParameterImpl<T> extends java.lang.Object implements jakarta.persistence.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
Constructors Constructor Description ParameterImpl(java.lang.Integer position, java.lang.Class<T> expectedValueType)
Construct a positional parameter with the given position as key and given expected value type.ParameterImpl(java.lang.String name, java.lang.Class<T> expectedValueType)
Construct a named parameter with the given name as key and given expected value type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
Equals if the other parameter has the same name or position.java.lang.String
getName()
java.lang.Class<T>
getParameterType()
java.lang.Integer
getPosition()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ParameterImpl
public ParameterImpl(java.lang.Integer position, java.lang.Class<T> expectedValueType)
Construct a positional parameter with the given position as key and given expected value type.
-
ParameterImpl
public ParameterImpl(java.lang.String name, java.lang.Class<T> expectedValueType)
Construct a named parameter with the given name as key and given expected value type.
-
-
Method Detail
-
getName
public final java.lang.String getName()
- Specified by:
getName
in interfacejakarta.persistence.Parameter<T>
-
getPosition
public final java.lang.Integer getPosition()
- Specified by:
getPosition
in interfacejakarta.persistence.Parameter<T>
-
getParameterType
public java.lang.Class<T> getParameterType()
- Specified by:
getParameterType
in interfacejakarta.persistence.Parameter<T>
-
equals
public boolean equals(java.lang.Object other)
Equals if the other parameter has the same name or position.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-