HHH-12116 - Positional parameters report position as name HHH-12101 - Remove support for legacy HQL-style positional parameters

This commit is contained in:
Andrea Boriero 2018-01-13 18:44:05 +00:00 committed by Steve Ebersole
parent 5460acd63a
commit ba95ac842a

View File

@ -64,6 +64,19 @@ else if ( NamedParameterSpecification.class.isInstance( specification ) ) {
namedSpecification.getName(),
k -> new NamedParameterInformationImpl( k, namedSpecification.getExpectedType() )
);
/*
If a previous reference to the NamedParameter already exists with expected type null and the new
reference expected type is not null then we add the type to the NamedParameterInformation.
This situation may occur when the same name parameter is used twice in the same query,
an example is ".... where :name is null or name.last = :name"
If info.getExpectedType() != null and also != namedSpecification.getExpectedType(), should an exception be thrown?
*/
if ( info.getExpectedType() == null && namedSpecification.getExpectedType() != null ) {
info.setExpectedType( namedSpecification.getExpectedType() );
}
info.addSourceLocation( i++ );
}
}