HHH-10893 - Fix Reusing Query but changing collection parameters returns wrong result
This commit is contained in:
parent
0e0f497c2a
commit
5cb5b68f9c
|
@ -81,4 +81,22 @@ public class NamedParameterDescriptor implements QueryParameter {
|
|||
public Type getType() {
|
||||
return expectedType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if ( this == o ) {
|
||||
return true;
|
||||
}
|
||||
if ( o == null || getClass() != o.getClass() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NamedParameterDescriptor that = (NamedParameterDescriptor) o;
|
||||
return getName().equals( that.getName() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getName().hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -586,9 +586,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
|
|||
);
|
||||
final QueryParameterBinding syntheticBinding = makeBinding( entry.getValue().getBindType() );
|
||||
syntheticBinding.setBindValue( bindValue );
|
||||
if ( parameterBindingMap.put( syntheticParam, syntheticBinding ) != null ) {
|
||||
throw new HibernateException( "Repeated usage of synthetic parameter name [" + syntheticName + "] while expanding list parameter." );
|
||||
}
|
||||
parameterBindingMap.put( syntheticParam, syntheticBinding );
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,4 +49,22 @@ public class QueryParameterNamedImpl<T> extends QueryParameterImpl<T> implements
|
|||
public boolean isJpaPositionalParameter() {
|
||||
return jpaStyle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if ( this == o ) {
|
||||
return true;
|
||||
}
|
||||
if ( o == null || getClass() != o.getClass() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QueryParameterNamedImpl<?> that = (QueryParameterNamedImpl<?>) o;
|
||||
return getName().equals( that.getName() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getName().hashCode();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue