|
The following method:
public <T> TypedQuery<X> setParameter(Parameter<T> param, T value)
in class org.hibernate.ejb.QueryImpl has a wrong parameter existence check in line 317:
if ( ! parameters.contains( param ) )
{
throw new IllegalArgumentException( "Specified parameter was not found in query" );
}
If you use a custom javax.persistence.Parameter implementation then this will never recognize your parameters since it cannot be equal to an existing parameter which is created at query creation time and is always an instance of org.hibernate.ejb.QueryImpl.ParameterImpl.
Instead of using Set.contains() and therefore implicitly using QueryImpl.ParameterImpl.equals() this check could be implemented by comparing parameter names or positions.
|